nccu-news/lib/news/engine.rb

57 lines
2.5 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__)
2015-08-13 11:50:49 +00:00
widget_methods ["widget","widget2"]
2014-11-12 10:18:09 +00:00
widget_settings [{"data_count"=>12}]
2015-03-30 07:08:28 +00:00
models_to_cache [:news_bulletin]
2014-11-07 08:44:11 +00:00
# taggable "NewsBulletin"
2015-03-30 07:29:17 +00:00
models_to_cache [:news_bulletin]
2014-11-07 08:44:11 +00:00
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 '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'
2023-09-24 07:19:52 +00:00
context_link 'news.admins',
:link_path=>"admin_news_admins_path" ,
:priority=>6,
:active_for_action=>{'admin/news'=>'admins'},
:available_for => 'managers'
2014-11-07 08:44:11 +00:00
end
end
end
end
end