Sha256: bf6e7350ecc6ba0958687312aa59c8f1d8f80b5aaf68c9421a0188be87f79a01

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

class Admin::Shop::PackagesController < Admin::ResourceController
  model_class ShopPackage
  
  helper :shop
  
  before_filter :config_global
  before_filter :config_index,  :only => [ :index ]
  before_filter :config_new,    :only => [ :new, :create ]
  before_filter :config_edit,   :only => [ :edit, :update ]
  before_filter :assets_global
  before_filter :assets_index,  :only => :index
  before_filter :assets_edit,   :only => [ :edit, :update ]
  
private
  
  def config_global
    @inputs   ||= []
    @meta     ||= []
    @buttons  ||= []
    @parts    ||= []
    @popups   ||= []
    
    @inputs   << 'name'
    @inputs   << 'price'
  end
  
  def config_index
    @buttons  << 'packages'
    @buttons  << 'variants'
    @buttons  << 'discounts'
  end
  
  def config_new
    @meta  << 'sku'
    
    @parts << 'description'
  end
  
  def config_edit
    @meta  << 'sku'
    
    @parts << 'description'
    @parts << 'products'
    
    @buttons << 'browse_products'
    
    @popups << 'browse_products'
  end
  
  def assets_global
  end
  
  def assets_index
    include_stylesheet 'admin/extensions/shop/index'
  end
  
  def assets_edit
    include_javascript 'admin/dragdrop'
    include_javascript 'admin/extensions/shop/edit'
    include_stylesheet 'admin/extensions/shop/edit'
    include_stylesheet 'admin/extensions/shop/packages/edit'
    include_javascript 'admin/extensions/shop/packages/edit'
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-shop-extension-0.11.5 app/controllers/admin/shop/packages_controller.rb
radiant-shop-extension-0.11.4 app/controllers/admin/shop/packages_controller.rb
radiant-shop-extension-0.11.3 app/controllers/admin/shop/packages_controller.rb
radiant-shop-extension-0.11.1 app/controllers/admin/shop/packages_controller.rb
radiant-shop-extension-0.11.0 app/controllers/admin/shop/packages_controller.rb