Sha256: 8293c5d943203091569bb9446ab3d6f73c9e107c52ad7045b3c17d360da8aab6

Contents?: true

Size: 1.24 KB

Versions: 33

Compression:

Stored size: 1.24 KB

Contents

module CabooseStore
  class CabooseStorePlugin < Caboose::CaboosePlugin
    def self.admin_nav(nav, user=nil, page=nil)
      return nav if user.nil?
      
      item = {
        'id'       => 'general-store',
        'text'     => 'General Store',
        'children' => []
      }
      
      item['children'] << { 'id' => 'categories', 'href' => '/admin/categories' , 'text' => 'Categories'  , 'modal' => false } if user.is_allowed('categories' , 'view')
      item['children'] << { 'id' => 'vendors'   , 'href' => '/admin/vendors'    , 'text' => 'Vendors'     , 'modal' => false } if user.is_allowed('vendors'    , 'view')
      item['children'] << { 'id' => 'products'  , 'href' => '/admin/products'   , 'text' => 'Products'    , 'modal' => false } if user.is_allowed('products'   , 'view')
      item['children'] << { 'id' => 'orders'    , 'href' => '/admin/orders'     , 'text' => 'Orders'      , 'modal' => false } if user.is_allowed('orders'     , 'view')    
      
      nav << item
      
      return nav
    end
    
    def self.javascripts(scripts)
      scripts << 'caboose_store/application'
      
      return scripts
    end
    
    #def self.login_success
    #  @order.update_attribute(:customer_id, session['app_user'].id)
    #end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
caboose-store-0.0.43 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.42 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.41 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.40 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.39 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.38 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.37 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.36 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.35 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.34 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.33 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.32 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.31 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.30 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.29 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.28 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.27 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.26 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.25 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.24 app/models/caboose_store/caboose_store_plugin.rb