e_paper/lib/e_paper/engine.rb

61 lines
2.1 KiB
Ruby

module EPaper
class Engine < ::Rails::Engine
initializer "e_paper" do
OrbitApp.registration "EPaper", :type => "ModuleApp" do
module_label "e_paper.e_paper"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ['subscriber_widget']
widget_settings [{"data_count"=>10}]
taggable "Paper"
categorizable
authorizable
frontend_enabled
data_count 1..10
side_bar do
head_label_i18n 'e_paper.e_paper', icon_class: "icons-book"
available_for "users"
active_for_controllers (['admin/e_papers'])
head_link_path "admin_e_papers_path"
context_link 'all',
:link_path=>"admin_e_papers_path" ,
:priority=>1,
:active_for_action=>{'admin/e_papers'=>"index"},
:available_for => 'users'
context_link 'e_paper.subscribers',
:link_path=>"subscribers_admin_e_papers_path" ,
:priority=>1,
:active_for_action=>{'admin/e_papers'=>"subscribers"},
:available_for => 'users'
# context_link 'new_',
# :link_path=>"new_admin_e_paper_path" ,
# :priority=>2,
# :active_for_action=>{'admin/e_papers'=>"new"},
# :available_for => 'sub_managers'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'e_paper').id}",
:priority=>3,
:active_for_action=>{'admin/e_papers'=>'categories'},
:active_for_category => 'e_paper',
:available_for => 'managers'
# context_link 'tags',
# :link_path=>"admin_module_app_tags_path" ,
# :link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'e_paper').id}",
# :priority=>5,
# :active_for_action=>{'admin/e_papers'=>'tags'},
# :active_for_tag => 'e_paper',
# :available_for => 'managers'
end
end
end
end
end