-#= page_title :index, <%= class_name %>

table.with-selection

thead
  tr

<% for attribute in attributes -%>

th= <%= class_name %>.human_attribute_name(:<%= attribute.name %>)

<% end -%>

    th.actions
tbody
  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
    tr data-record={id: <%= singular_table_name %>.id}.to_json

<% for attribute in attributes -%>

td= link_to <%= singular_table_name %>.<%= attribute.name %>, <%= singular_table_name %>

<% end -%> <% for attribute in attributes -%>

td= <%= singular_table_name %>.<%= attribute.name %>

<% end -%>

td.actions
  = link_to content_tag(:span, '', class: 'icon'), <%= singular_table_name %>, class: 'table-new-button'
  = link_to content_tag(:span, '', class: 'icon'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'table-edit-button'
  = link_to content_tag(:span, '', class: 'icon'), <%= singular_table_name %>, method: :delete, class: 'table-destroy-button', data: { confirm: 'Are you sure?' }

.page-links

button.actions-button onclick="window.location = $(this).data('url') + '?' + $.param({ids: MultiSelect.selected_ids()})" data-url=collection_edit_<%= plural_table_name %>_path Actions
= link_to t('action.new.link', model: <%= class_name %>.model_name.human), new_<%= singular_table_name %>_path, class: 'record-new-button'