From c08c29b0e77fdaefe9b6a738a8bd1a5b507cbc47 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 17 Apr 2015 18:27:50 +0200 Subject: [PATCH] Don't show deleted ordergroups (closes foodcoops/foodsoft#362) --- app/views/finance/financial_transactions/_ordergroup.haml | 2 +- app/views/group_order_articles/_form.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/finance/financial_transactions/_ordergroup.haml b/app/views/finance/financial_transactions/_ordergroup.haml index 48f4e2c9..f4ca189d 100644 --- a/app/views/finance/financial_transactions/_ordergroup.haml +++ b/app/views/finance/financial_transactions/_ordergroup.haml @@ -1,7 +1,7 @@ %tr.transaction %td = 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= link_to t('.remove'), "#", :title => t('.remove_group'), 'data-remove-transaction' => true, class: 'btn btn-small' diff --git a/app/views/group_order_articles/_form.html.haml b/app/views/group_order_articles/_form.html.haml index 9b7eae2d..e0921d4e 100644 --- a/app/views/group_order_articles/_form.html.haml +++ b/app/views/group_order_articles/_form.html.haml @@ -4,7 +4,7 @@ = close_button :modal %h3= t('.amount_change_for', article: @order_article.article.name) .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? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}