foodsoft/app/views/articles/_import_search_results.haml

33 lines
1.3 KiB
Plaintext

- if @articles.empty?
%p= t '.not_found'
- else
= pagination_links_remote @articles, :params => {:search => search_params}
%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
%th= heading_helper Article, :unit_quantity, short: true
%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}"
- if @supplier.articles.undeleted.where(order_number: article.number).exists?
%i.icon-ok= t '.already_imported'
- else
= link_to t('.action_import'), import_supplier_articles_path(@supplier, :shared_article_id => article.id),
:remote => true, class: 'btn btn-small btn-success'