foodsoft/app/views/articles/_import_search_results.haml

34 lines
1.4 KiB
Text
Raw Permalink Normal View History

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
2012-10-19 01:12:47 +02:00
%table.table.table-striped
%thead
%tr
%th= heading_helper Article, :name
%th= heading_helper Article, :origin
%th= heading_helper Article, :manufacturer
%th= heading_helper Article, :note
%th{:style => "width:4em"}= heading_helper Article, :price
%th= heading_helper Article, :unit
2012-10-19 01:12:47 +02:00
%th
%tbody
- for article in @articles
2014-02-24 14:07:03 +01:00
%tr{id: "shared_article_#{article.id}"}
%td= highlight article.name, params.fetch(:name_cont_all_joined, '').split(' ')
2012-10-19 01:12:47 +02:00
%td= article.origin
%td= article.manufacturer
2014-02-24 14:07:03 +01:00
%td{title: article.note}= truncate(article.note, length: 11)
2012-10-19 01:12:47 +02:00
%td= number_to_currency(article.price)
%td
2014-02-24 14:07:03 +01:00
= article.unit
- if article.unit_quantity > 1
%span{style: 'color: grey'} × #{article.unit_quantity} #{pkg_helper_icon}
%td.actions
2012-10-19 01:12:47 +02:00
- logger.debug "[debug] #{article.attributes.inspect}"
- 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
2014-02-24 14:07:03 +01:00
= link_to t('.action_import'), import_supplier_articles_path(@supplier, shared_article_id: article.id, direct: true),
remote: true, class: 'btn btn-small btn-success'