app/views/app_admin/meta_keys/index.html.haml

Summary

Maintainability
Test Coverage
%h1.text-center
  %i.fa.fa-file
  Meta Keys

.well.pull-right

  = form_tag app_admin_meta_keys_path, method: 'GET', class: 'form-inline' do

    .form-group
      = text_field_tag 'filter[label]', params.try(:[], :filter).try(:[], :label), placeholder: "Label", class: "form-control"

    .form-group
      %label Type of
      %select.form-control{name: 'filter[meta_datum_object_type]'}
        %option{value: ''} All
        = options_for_select MetaKey.object_types, @meta_datum_object_type

    .form-group
      %label Context
      %select.form-control{name: 'filter[context]'}
        %option{value: ''} All
        = options_from_collection_for_select ::Context.order(:label), 'label', 'label', @context

    .form-group
      %label Used?
      %select.form-control{name: 'filter[is_used]'}
        %option{value: ''} All
        = options_for_select([["Used", true], ["Not used", false]], @is_used)

    .form-group
      = button_tag type: 'submit', class: 'btn btn-sm' do
        %i.icon-filter
        Apply

    = link_to "Reset", app_admin_meta_keys_path

%ul.list-inline
  %li
    = link_to new_app_admin_meta_key_path, class: 'btn btn-success' do
      %i.icon-plus
      New Meta Key
.row.pull-left
  = "Number of meta keys found:"
  %span#counter #{@meta_keys.total_count}

%table.table.table-striped
  %thead
    %tr
      %th Label
      %th.no-wrap Meta datum object type
      %th Amount of resources
      %th Terms
      %th Contexts
      %th.no-wrap Used / Not used
      %th
  %tbody
    =render @meta_keys

= paginate @meta_keys, theme: 'app_admin'