nccu-news/lib/news/engine.rb

57 lines
2.5 KiB
Ruby

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"]
widget_settings [{"data_count"=>12}]
models_to_cache [:news_bulletin]
# taggable "NewsBulletin"
models_to_cache [:news_bulletin]
categorizable
authorizable
frontend_enabled
data_count 1..10
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