Auto-merge from CI [skip ci]

This commit is contained in:
Continuous Integration
2015-05-29 12:44:44 +10:00
2 changed files with 14 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ module Admin
before_filter :load_enterprise_set, :only => :index
before_filter :load_countries, :except => [:index, :set_sells, :check_permalink]
before_filter :load_methods_and_fees, :only => [:new, :edit, :update, :create]
before_filter :load_groups, :only => [:new, :edit, :update, :create]
before_filter :load_taxons, :only => [:new, :edit, :update, :create]
before_filter :check_can_change_sells, only: :update
before_filter :check_can_change_bulk_sells, only: :bulk_update
@@ -127,6 +128,10 @@ module Admin
@enterprise_fees = EnterpriseFee.managed_by(spree_current_user).for_enterprise(@enterprise).order(:fee_type, :name).all
end
def load_groups
@groups = EnterpriseGroup.managed_by(spree_current_user) | @enterprise.groups
end
def load_taxons
@taxons = Spree::Taxon.order(:name)
end

View File

@@ -5,15 +5,15 @@
%span.required *
.eight.columns.omega
= f.text_field :name, { placeholder: "eg. Professor Plum's Biodynamic Truffles" }
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :group_ids, 'Groups'
.with-tip{'data-powertip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."}
%a What's this?
.eight.columns.omega
= f.collection_select :group_ids, EnterpriseGroup.all, :id, :name, {}, class: "select2 fullwidth", multiple: true, placeholder: "Start typing to search available groups..."
- if @groups.present?
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :group_ids, 'Groups'
.with-tip{'data-powertip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."}
%a What's this?
.eight.columns.omega
= f.collection_select :group_ids, @groups, :id, :name, {}, class: "select2 fullwidth", multiple: true, placeholder: "Start typing to search available groups..."
.row
.three.columns.alpha