Replace 'own' js table sorting by stupidtable plugin

This commit is contained in:
Julius 2013-07-16 22:01:56 +02:00
parent 4fafdcb7ad
commit 7fd8abf381
5 changed files with 199 additions and 82 deletions

View file

@ -94,11 +94,10 @@
= f.association :supplier, :as => :hidden
%h2= t '.title_select_stock_articles'
%table.table.table-hover#stock_articles_for_adding
%table#stock_articles_for_adding.table.table-hover.stupidtable
%thead
%tr
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
= t '.article'
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
%th= t '.price'
%th= t '.unit'
%th= t '.category'
@ -115,11 +114,10 @@
= render :partial => 'stock_article_for_adding', :locals => {:article => article}
%h2= t '.title_fill_quantities'
%table.table#stock_changes
%table.table#stock_changes.stupidtable
%thead
%tr
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
= t '.article'
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
%th= t '.price'
%th= t '.unit'
%th= t '.quantity'

View file

@ -1,9 +1,9 @@
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false )
%tr{:id => "stock_article_#{article.id}", :class => css_class}
%td.sort-by-name= article.name
%td= article.name
%td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}}= number_to_currency article.price
%td= article.unit
%td.sort-by-category= article.article_category.name
%td= article.article_category.name
%td
= link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini'
= link_to t('.action_other_price'), copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => article.id), remote: true, class: 'btn btn-mini'

View file

@ -1,7 +1,7 @@
- stock_change = f.object
- stock_article = stock_change.stock_article
%tr{:id => "stock_change_stock_article_#{stock_article.id}", :data => {:id => stock_article.id}}
%td.sort-by-name
%td
%span.stock_article_name= stock_change.stock_article.name
= f.association :stock_article, :as => :hidden
%td.price{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_article})}}= number_to_currency stock_article.price