Add stock_article_selection (deleting multiple stock articles at once)
This commit is contained in:
parent
ecb7ce7cd3
commit
099e2b9b06
13 changed files with 217 additions and 34 deletions
|
|
@ -142,7 +142,7 @@ module ApplicationHelper
|
|||
# offers a link for writing message to user
|
||||
# checks for nil (useful for relations)
|
||||
def link_to_user_message_if_valid(user)
|
||||
user.nil? ? '??' : ( link_to user.nick, user_message_path(user), :title => 'Nachricht schreiben' )
|
||||
user.nil? ? '??' : ( link_to user.nick, new_message_path(:message => {:mail_to => user.id}), :title => 'Nachricht schreiben' )
|
||||
end
|
||||
|
||||
def bootstrap_flash
|
||||
|
|
|
|||
2
app/helpers/stock_article_selections_helper.rb
Normal file
2
app/helpers/stock_article_selections_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module StockArticleSelectionsHelper
|
||||
end
|
||||
|
|
@ -1,7 +1,18 @@
|
|||
# encoding: utf-8
|
||||
module StockitHelper
|
||||
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
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue