diff --git a/app/views/registrar/contacts/_search_form.html.erb b/app/views/registrar/contacts/_search_form.html.erb new file mode 100644 index 000000000..66bb263bd --- /dev/null +++ b/app/views/registrar/contacts/_search_form.html.erb @@ -0,0 +1,131 @@ +<%= search_form_for [:registrar, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| %> +
+
+
+ <%= f.label :name %> + <%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %> +
+
+ +
+
+ <%= f.label t(:id) %> + <%= f.search_field :code_eq, class: 'form-control', placeholder: t(:id) %> +
+
+ +
+
+ <%= f.label t(:ident) %> + <%= f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident) %> +
+
+ +
+
+ <%= label_tag t(:ident_type) %> + <%= select_tag '[q][ident_type_eq]', options_for_select(ident_types, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %> +
+
+
+ +
+
+
+ <%= f.label t(:email) %> + <%= f.search_field :email_matches, class: 'form-control', placeholder: t(:email) %> +
+
+ +
+
+ <%= label_tag t(:country) %> + <%= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %> +
+
+ +
+
+ <%= label_tag t(:contact_type) %> + <%= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact'], ['registrant', 'registrant']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %> +
+
+
+ +
+
+
+ <%= f.label t(:registrar_name) %> + <%= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) %> +
+
+ +
+
+ <%= f.label t(:created_at_from) %> + <%= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:created_at_from) %> +
+
+ +
+
+ <%= f.label t(:created_at_until) %> + <%= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:created_at_until) %> +
+
+ +
+
+ <%= f.label t(:updated_at) %> + <%= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control js-datepicker', placeholder: t(:updated_at) %> +
+
+
+ +
+
+
+ <%= label_tag t(:status) %> + <%= select_tag :statuses_contains, options_for_select(Contact::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %> +
+
+ +
+
+ <%= label_tag t(:results_per_page) %> + <%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %> +
+
+ +
+ + <%= link_to(t('.reset_btn'), registrar_contacts_path, class: 'btn btn-default') %> +
+
+ +
+
+
+ + +
+
+
+
+
+
+<% end %> diff --git a/app/views/registrar/contacts/index.html.erb b/app/views/registrar/contacts/index.html.erb index 5fc7ce09c..4a7e8759a 100644 --- a/app/views/registrar/contacts/index.html.erb +++ b/app/views/registrar/contacts/index.html.erb @@ -4,123 +4,7 @@ <%= render 'shared/title', name: t(:contacts) %>
- <%= search_form_for [:registrar, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| %> -
-
-
- <%= f.label :name %> - <%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %> -
-
-
-
- <%= f.label t(:id) %> - <%= f.search_field :code_eq, class: 'form-control', placeholder: t(:id) %> -
-
-
-
- <%= f.label t(:ident) %> - <%= f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident) %> -
-
-
-
- <%= label_tag t(:ident_type) %> - <%= select_tag '[q][ident_type_eq]', options_for_select(ident_types, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %> -
-
-
-
-
-
- <%= f.label t(:email) %> - <%= f.search_field :email_matches, class: 'form-control', placeholder: t(:email) %> -
-
-
-
- <%= label_tag t(:country) %> - <%= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %> -
-
-
-
- <%= label_tag t(:contact_type) %> - <%= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact'], ['registrant', 'registrant']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %> -
-
-
-
-
-
- <%= f.label t(:registrar_name) %> - <%= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) %> -
-
-
-
- <%= f.label t(:created_at_from) %> - <%= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:created_at_from) %> -
-
-
-
- <%= f.label t(:created_at_until) %> - <%= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:created_at_until) %> -
-
-
-
- <%= f.label t(:updated_at) %> - <%= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control js-datepicker', placeholder: t(:updated_at) %> -
-
-
-
-
-
- <%= label_tag t(:status) %> - <%= select_tag :statuses_contains, options_for_select(Contact::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %> -
-
-
-
- <%= label_tag t(:results_per_page) %> - <%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %> -
-
-
- - <%= link_to(t('.reset_btn'), registrar_contacts_path, class: 'btn btn-default') %> -
-
-
-
-
- - -
-
-
-
-
-
- <% end %> + <%= render 'search_form' %>

diff --git a/config/locales/registrar/contacts.en.yml b/config/locales/registrar/contacts.en.yml index 84afd481d..7eeb3c518 100644 --- a/config/locales/registrar/contacts.en.yml +++ b/config/locales/registrar/contacts.en.yml @@ -1,7 +1,7 @@ en: registrar: contacts: - index: + search_form: reset_btn: Reset partials: