Story#112601637 - admin contacts has filter to get only ident_country_code

This commit is contained in:
Vladimir Krylov 2016-03-17 13:59:42 +02:00
parent 2c059f9176
commit 58e383bd25
2 changed files with 8 additions and 1 deletions

View file

@ -20,6 +20,8 @@ class Admin::ContactsController < AdminController
else
contacts = Contact.includes(:registrar)
end
contacts = contacts.where("ident_country_code is null or ident_country_code=''") if params[:only_no_country_code].eql?('1')
normalize_search_parameters do
@q = contacts.search(search_params)

View file

@ -59,7 +59,12 @@
.form-group
= label_tag t(:results_per_page)
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
.col-md-3{style: 'padding-top: 25px;'}
.col-md-3
.form-group
= label_tag "Only wout ident CC?"
= check_box_tag :only_no_country_code, '1',params[:only_no_country_code].eql?('1'), class: 'form-control'
.row
.col-md-3{style: 'padding-top: 25px;float:right;'}
%button.btn.btn-primary
&nbsp;
%span.glyphicon.glyphicon-search