Sort enterprises by name on enterprise fees admin page

This commit is contained in:
Rohan Mitchell
2014-02-26 15:38:41 +11:00
parent f7e1befc75
commit adf4c0e387
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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"}