Improved error data passing.
This commit is contained in:
parent
1c9fad0a7b
commit
bb25bdc6eb
2 changed files with 15 additions and 13 deletions
|
|
@ -29,13 +29,12 @@
|
|||
- for article in articles
|
||||
/ check if the article is selected or has an error
|
||||
- included = @order.article_ids.include?(article.id.to_s)
|
||||
- row_class = ''
|
||||
- if included
|
||||
- included_class = 'selected'
|
||||
- elsif @order.errors.has_key?(:articles) and @order.articles_to_be_removed_and_ordered.map{|a| a.article_id}.include?(article.id)
|
||||
- included_class = 'error'
|
||||
- else
|
||||
- included_class = ''
|
||||
%tr{:class => included_class, :id => article.id.to_s }
|
||||
- row_class = 'selected'
|
||||
- elsif @order.erroneous_article_ids.include?(article.id)
|
||||
- row_class = 'error'
|
||||
%tr{class: row_class, id: article.id}
|
||||
%td= check_box_tag "order[article_ids][]", article.id, included, :id => "checkbox_#{article.id}"
|
||||
%td.click-me{'data-check-this' => "#checkbox_#{article.id}"}= article.name
|
||||
%td=h truncate article.note, :length => 25
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue