foodsoft/app/helpers/stockit_helper.rb

19 lines
642 B
Ruby
Raw Normal View History

# encoding: utf-8
2009-01-18 17:42:51 +01:00
module StockitHelper
2012-10-29 18:28:17 +01:00
def stock_article_classes(article)
class_names = []
class_names << "unavailable" if article.quantity_available <= 0
class_names.join(" ")
end
def stock_article_delete_checkbox(article)
if article.quantity_available <= 0
check_box_tag "stock_article_selection[stock_article_ids][]", article.id, false,
{ :id => "checkbox_#{article.id}", :title => 'Zum löschen markieren' }
else
check_box_tag 'checkall', '1', false,
{ :disabled => true, :title => 'Verfügbare Artikel können nicht gelöscht werden.', :class => 'unavailable' }
end
end
2009-01-18 17:42:51 +01:00
end