nccu-news/lib/news/engine.rb

55 lines
2.4 KiB
Ruby
Raw Normal View History

2014-11-07 08:44:11 +00:00
module News
class Engine < ::Rails::Engine
initializer "news" do
OrbitApp.registration "News", :type => "ModuleApp" do
module_label "news.news"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ["widget"]
2014-11-12 10:18:09 +00:00
widget_settings [{"data_count"=>12}]
2014-11-07 08:44:11 +00:00
# taggable "NewsBulletin"
categorizable
authorizable
frontend_enabled
2014-11-12 10:18:09 +00:00
data_count 1..10
2014-11-07 08:44:11 +00:00
side_bar do
head_label_i18n 'news.news', icon_class: "icons-book-2"
available_for "users"
active_for_controllers (['admin/news'])
head_link_path "admin_news_index_path"
context_link 'news.all_articles',
:link_path=>"admin_news_index_path" ,
:priority=>1,
:active_for_action=>{'admin/news'=>'index'},
:available_for => 'users'
context_link 'new_',
:link_path=>"new_admin_news_path" ,
:priority=>2,
:active_for_action=>{'admin/news'=>'news'},
:available_for => 'sub_managers'
context_link 'news.admins',
:link_path=>"admin_news_admins_path" ,
:priority=>4,
:active_for_action=>{'admin/news'=>'admins'},
:available_for => 'managers'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'news').id}",
:priority=>3,
:active_for_action=>{'admin/news'=>'categories'},
:active_for_category => 'News',
:available_for => 'managers'
context_link 'tags',
:link_path=>"admin_module_app_tags_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'news').id}",
:priority=>4,
:active_for_action=>{'admin/news'=>'tags'},
:active_for_tag => 'News',
:available_for => 'managers'
end
end
end
end
end