2012-10-19 01:12:47 +02:00
|
|
|
- if @articles.empty?
|
2013-03-22 00:20:30 +01:00
|
|
|
%p= t '.not_found'
|
2012-10-19 01:12:47 +02:00
|
|
|
- else
|
|
|
|
= pagination_links_remote @articles, :params => {:search => search_params}
|
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-03-22 00:20:30 +01:00
|
|
|
%th= t 'simple_form.labels.article.name'
|
|
|
|
%th= t 'simple_form.labels.article.origin'
|
|
|
|
%th= t 'simple_form.labels.article.manufacturer'
|
|
|
|
%th= t 'simple_form.labels.article.note'
|
|
|
|
%th{:style => "width:4em"}= t 'simple_form.labels.defaults.price'
|
|
|
|
%th= t 'simple_form.labels.article.unit'
|
|
|
|
%th= t 'simple_form.labels.defaults.unit_quantity'
|
2012-10-19 01:12:47 +02:00
|
|
|
%th
|
|
|
|
%tbody
|
|
|
|
- for article in @articles
|
|
|
|
%tr
|
|
|
|
%td= highlight article.name, params[:search][:name_contains_all]
|
|
|
|
%td= article.origin
|
|
|
|
%td= article.manufacturer
|
|
|
|
%td= article.note
|
|
|
|
%td= number_to_currency(article.price)
|
|
|
|
%td= article.unit
|
|
|
|
%td= article.unit_quantity
|
|
|
|
%td
|
|
|
|
- logger.debug "[debug] #{article.attributes.inspect}"
|
2013-03-17 20:02:14 +01:00
|
|
|
- if @supplier.articles.undeleted.where(order_number: article.number).exists?
|
2013-03-22 00:20:30 +01:00
|
|
|
%i.icon-ok= t '.already_imported'
|
2012-10-19 01:12:47 +02:00
|
|
|
- else
|
2013-03-22 00:20:30 +01:00
|
|
|
= link_to t('.action_import'), import_supplier_articles_path(@supplier, :shared_article_id => article.id),
|
2012-10-19 01:12:47 +02:00
|
|
|
:remote => true, class: 'btn btn-small btn-success'
|