From adf4c0e387292ea6395f39b6389fa28900eacd92 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 26 Feb 2014 15:38:41 +1100 Subject: [PATCH] Sort enterprises by name on enterprise fees admin page --- app/controllers/admin/enterprise_fees_controller.rb | 1 + app/views/admin/enterprise_fees/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/enterprise_fees_controller.rb b/app/controllers/admin/enterprise_fees_controller.rb index 6e1a7da113..085828d7b3 100644 --- a/app/controllers/admin/enterprise_fees_controller.rb +++ b/app/controllers/admin/enterprise_fees_controller.rb @@ -8,6 +8,7 @@ module Admin def index @include_calculators = params[:include_calculators].present? @enterprise = current_enterprise + @enterprises = Enterprise.managed_by(spree_current_user).by_name blank_enterprise_fee = EnterpriseFee.new blank_enterprise_fee.enterprise = current_enterprise diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index a59ffc99e0..d3e9a0b88c 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -25,7 +25,7 @@ %tr{'ng-repeat' => 'enterprise_fee in enterprise_fees | filter:query'} %td = f.ng_hidden_field :id - = f.ng_collection_select :enterprise_id, Enterprise.managed_by(spree_current_user), :id, :name, 'enterprise_fee.enterprise_id', :include_blank => true + = f.ng_collection_select :enterprise_id, @enterprises, :id, :name, 'enterprise_fee.enterprise_id', :include_blank => true %td= f.ng_select :fee_type, enterprise_fee_type_options, 'enterprise_fee.fee_type' %td= f.ng_text_field :name %td= f.ng_collection_select :calculator_type, @calculators, :name, :description, 'enterprise_fee.calculator_type', {'class' => 'calculator_type', 'ng-model' => 'calculatorType', 'spree-ensure-calculator-preferences-match-type' => "1"}