digital-archive/lib/digital_archive/engine.rb

54 lines
2.0 KiB
Ruby
Raw Normal View History

2015-08-11 08:39:31 +00:00
module DigitalArchive
class Engine < ::Rails::Engine
initializer "digital_archive" do
OrbitApp.registration "DigitalArchive", :type => "ModuleApp" do
module_label "digital_archive.digital_archive"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ["widget"]
widget_settings [{"data_count"=>10}]
taggable "DigitalContentArchive"
categorizable
authorizable
frontend_enabled
data_count 1..10
side_bar do
head_label_i18n 'digital_archive.digital_archive', icon_class: "icons-archive"
available_for "users"
active_for_controllers (['admin/digital_archives'])
head_link_path "admin_digital_archives_path"
context_link 'all',
:link_path=>"admin_digital_archives_path" ,
:priority=>1,
:active_for_action=>{'admin/controller_name'=>'index'},
:available_for => 'users'
context_link 'new_',
:link_path=>"new_admin_digital_archive_path" ,
:priority=>2,
:active_for_action=>{'admin/digital_archives'=>"new"},
:available_for => 'sub_managers'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'digital_archive').id}",
:priority=>3,
:active_for_action=>{'admin/digital_archives'=>'categories'},
:active_for_category => 'DigitalArchive',
:available_for => 'managers'
context_link 'tags',
:link_path=>"admin_module_app_tags_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'digital_archive').id}",
:priority=>4,
:active_for_action=>{'admin/digital_archives'=>'tags'},
:active_for_tag => 'DigitalArchive',
:available_for => 'managers'
end
end
end
end
end