Files
mozo-backend/app/views/suppliers/products/index.html.slim
T
2013-01-19 17:14:33 +01:00

30 lines
1.5 KiB
Plaintext

- model_class = Product
.page-header= title :index, model_class
.well
- if @products.any?
table.table
thead
tr
th data-t="attributes.product.name" = model_class.human_attribute_name(:name)
th data-t="attributes.product.code" = model_class.human_attribute_name(:code)
th.currency data-t="attributes.product.price" = model_class.human_attribute_name(:price)
th data-t="models.product_category" = ProductCategory.model_name.human_plural
th.timestamp data-t="attributes.product.created_at" = model_class.human_attribute_name(:created_at)
th.actions data-t="helpers.actions.title" =t 'helpers.actions.title'
tbody
- @products.each do |product|
tr
td.link= link_to product.name, [:suppliers, product]
td= product.code
td.currency=currency product.price
td.link= product.category_links namespace: :suppliers
td.timestamp=l product.created_at, format: :short
td.actions
= link_to t('helpers.links.edit'), [:edit, :suppliers, product], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), [:suppliers, 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_suppliers_product_path(product_category_id: @product_category.try(:id)), class: 'btn btn-primary'
/a.btn.btn-primary data-t="helpers.links.new" href=new_suppliers_product_path