Files
mozo-backend/app/views/admin/products/index.html.slim
T

29 lines
1.1 KiB
Plaintext

- model_class = Product
- title :index, model_class
- if @products.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:name)
th= model_class.human_attribute_name(:code)
th= model_class.human_attribute_name(:price)
th= Supplier.model_name.human
th.timestamp= model_class.human_attribute_name(:created_at)
th.actions=t 'helpers.actions.title'
tbody
- @products.each do |product|
tr
td.link= link_to product.name, [:admin, product]
td= product.code
td= product.price
td.link= link_to_if product.supplier.present?, product.supplier.try(:name), [:admin, product.supplier]
td.timestamp=l product.created_at, format: :short
td.actions
= link_to t('helpers.links.edit'), [:edit, :admin, product], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), [:admin, product], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_admin_product_path, class: 'btn btn-primary'