Don't show deleted ordergroups (closes foodcoops/foodsoft#362)

This commit is contained in:
wvengen 2015-04-17 18:27:50 +02:00
parent a016f0d7dc
commit c08c29b0e7
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
%tr.transaction %tr.transaction
%td %td
= select_tag 'financial_transactions[][ordergroup_id]', = select_tag 'financial_transactions[][ordergroup_id]',
options_for_select(Ordergroup.order(:name).map { |g| [ g.name, g.id ] }) options_for_select(Ordergroup.undeleted.order(:name).map { |g| [ g.name, g.id ] })
%td= text_field_tag 'financial_transactions[][amount]', nil, class: 'input-small' %td= text_field_tag 'financial_transactions[][amount]', nil, class: 'input-small'
%td= link_to t('.remove'), "#", :title => t('.remove_group'), 'data-remove-transaction' => true, %td= link_to t('.remove'), "#", :title => t('.remove_group'), 'data-remove-transaction' => true,
class: 'btn btn-small' class: 'btn btn-small'

View file

@ -4,7 +4,7 @@
= close_button :modal = close_button :modal
%h3= t('.amount_change_for', article: @order_article.article.name) %h3= t('.amount_change_for', article: @order_article.article.name)
.modal-body .modal-body
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] } = form.input :ordergroup_id, as: :select, collection: Ordergroup.undeleted.map { |g| [g.name, g.id] }
= form.input :result, hint: I18n.t('group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix? = form.input :result, hint: I18n.t('group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix?
.modal-footer .modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}