Files
mozo-backend/app/views/suppliers/tables/index.html.slim
T
2014-04-18 20:38:13 +02:00

36 lines
1.7 KiB
Plaintext

- model_class = Table
div.page-header= title :index, model_class
= form_tag({}, method: :get) do
label.number for="filter-from_number" data-t="attributes.table.from_number"
input#filter-from_number.number type="number" size=4 value=params[:from_number] name="from_number"
label.number for="filter-to_number" data-t="attributes.table.to_number"
input#filter-to_number.number type="number" size=4 value=params[:to_number] name="to_number"
'
= submit_tag 'Filter', class: 'apply-filter'
- if @tables.any?
= paginate @tables
table.table
thead
tr
th.link data-t="attributes.table.number"= model_class.human_attribute_name(:number)
th.link data-t="models.section"= Section.model_name.human
th.timestamp data-t="attributes.table.created_at"= model_class.human_attribute_name(:created_at)
th.actions data-t="helpers.actions.title"=t 'helpers.actions.title'
tbody
- @tables.each do |table|
tr
td.link= link_to table.number, [:suppliers, table]
td.link= link_to_if table.section.present?, table.section.try(:title), [:suppliers, table.section]
td.timestamp data-time=table.created_at.try(:utc).try(:iso8601)
td.actions
= link_to [:edit, :suppliers, table], class: 'table-edit' do
span data-title="helpers.links.edit"
= link_to [:suppliers, table], method: :delete, data: {confirm: are_you_sure? }, class: 'table-destroy' do
span data-title="helpers.links.destroy"
- else
= no_content_given model_class
= supplier_form_actions :new, for: :tables do
= link_to qr_codes_suppliers_tables_path(params.slice(:from_number, :to_number)), class: 'form-action-qr-codes', target: :_blank
span data-t="tables.qr_codes.link"