Files
mozo-backend/app/views/products/index.html.slim
T
2012-08-29 17:42:04 +02:00

31 lines
1.3 KiB
Plaintext

- model_class = Product
.page-header= 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= ProductCategory.model_name.human
th= Supplier.model_name.human
th.timestamp= model_class.human_attribute_name(:created_at)
th.actions=t 'helpers.actions'
tbody
- @products.each do |product|
tr
td.link= link_to product.name, product
td= product.code
td= product.price
td.link= link_to_if product.product_category.present?, product.product_category.try(:name), product.product_category
td.link= link_to_if product.supplier.present?, product.supplier.try(:name), product.supplier
td.timestamp=l product.created_at, format: :short
td.actions
= link_to t('helpers.links.edit'), [:edit, product], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), 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_product_path, class: 'btn btn-primary'