From 404e52faf6b01f42e2f79c9836358b94765b2a5c Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 10 Feb 2016 16:03:53 +0200 Subject: [PATCH] 105842700-statuses_and_domains --- .../registrants/partials/_domains.haml | 30 +++++++++++++++++++ .../registrants/partials/_statuses.haml | 21 +++++++++++++ app/views/registrant/registrants/show.haml | 7 ++++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 app/views/registrant/registrants/partials/_domains.haml create mode 100644 app/views/registrant/registrants/partials/_statuses.haml diff --git a/app/views/registrant/registrants/partials/_domains.haml b/app/views/registrant/registrants/partials/_domains.haml new file mode 100644 index 000000000..d0180532d --- /dev/null +++ b/app/views/registrant/registrants/partials/_domains.haml @@ -0,0 +1,30 @@ +- domains = contact.all_domains(page: params[:domain_page], per: 20, params: params) +#contacts.panel.panel-default + .panel-heading + .pull-left + = t(:domains) + .pull-right + = form_tag request.path, method: :get do + = select_tag :domain_filter, options_for_select(%w(Registrant AdminDomainContact TechDomainContact), selected: params[:domain_filter]), + include_blank: true, class: 'form-control2 selectize2' + %button.btn.btn-primary + %span.glyphicon.glyphicon-search + .clearfix + + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name + %th{class: 'col-xs-3'}=custom_sort_link t(:registrar), :registrar_name + %th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to + %th{class: 'col-xs-3'}= t(:roles) + %tbody + - domains.each do |x| + %tr + %td= link_to(x.name, [:registrant, x]) + %td= link_to(x.registrar, [:registrant, x.registrar]) + %td= l(x.valid_to, format: :short) + %td= x.roles.join(", ") + += paginate domains, param_name: :domain_page \ No newline at end of file diff --git a/app/views/registrant/registrants/partials/_statuses.haml b/app/views/registrant/registrants/partials/_statuses.haml new file mode 100644 index 000000000..c39075754 --- /dev/null +++ b/app/views/registrant/registrants/partials/_statuses.haml @@ -0,0 +1,21 @@ +- panel_class = contact.errors.messages[:statuses] ? 'panel-danger' : 'panel-default' +#contact_statuses.panel{class: panel_class} + .panel-heading.clearfix + = t(:statuses) + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-6'}= t(:status) + %th{class: 'col-xs-6'}= t(:notes) + %tbody + - contact.statuses.each do |status| + %tr + %td= status + %td= contact.status_notes[status] + + - if contact.errors.messages[:statuses] + %tfoot + - @domain.errors.messages[:statuses].each do |s| + %tr + %td{colspan: 4}= s diff --git a/app/views/registrant/registrants/show.haml b/app/views/registrant/registrants/show.haml index 5b2a527ca..3aa458973 100644 --- a/app/views/registrant/registrants/show.haml +++ b/app/views/registrant/registrants/show.haml @@ -72,4 +72,9 @@ %dd= @contact.state %dt= t(:country) - %dd= @contact.country \ No newline at end of file + %dd= @contact.country + +.row + .col-md-12= render 'registrant/registrants/partials/statuses', contact: @contact +.row + .col-md-12= render 'registrant/registrants/partials/domains', contact: @contact \ No newline at end of file