app/views/admin/blocked_domains/index.haml
- content_for :actions do
= link_to(t('.new_btn'), new_admin_blocked_domain_path, class: 'btn btn-primary')
= render 'shared/title', name: t('.title')
.row
.col-md-12
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
.row
.col-md-3
.form-group
= f.label :name
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
.col-md-3
.form-group
= 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)
.col-md-3
.form-group
= 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)
.row
.col-md-3
.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-4{style: 'padding-top: 25px;'}
%button.btn.btn-primary
%span.glyphicon.glyphicon-search
= link_to(t('.csv_btn'), admin_blocked_domains_path(format: :csv, params: params.permit!), class: 'btn btn-default')
= link_to(t('.reset_btn'), admin_blocked_domains_path, class: 'btn btn-default')
%hr
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-2'}
= sort_link(@q, 'name')
%th{class: 'col-xs-2'}
= sort_link(@q, 'created_at', t(:created_at))
%th{class: 'col-xs-2'}
= sort_link(@q, 'updated_at', t(:updated_at))
%th{class: 'col-xs-1'}
= t(:actions)
%tbody
- @domains.each do |x|
%tr
%td= x.name
%td= l(x.created_at, format: :short)
%td= l(x.updated_at, format: :short)
%td
%div{class: 'text-center'}
= link_to(t(:delete), delete_admin_blocked_domain_path(id: x.id),
data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger btn-xs')
.row
.col-md-6
= paginate @domains
.col-md-6.text-right
.pagination
= t(:result_count, count: @domains.total_count)