Files

44 lines
1.7 KiB
Ruby

module Survey
class Engine < ::Rails::Engine
initializer "survey" do
Rails.application.config.to_prepare do
OrbitApp.registration "Survey", :type => "ModuleApp" do
module_label "survey.survey"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ["widget","widget1"]
widget_settings [{"data_count"=>10}]
categorizable
authorizable
frontend_enabled
data_count 1..20
side_bar do
head_label_i18n 'survey.survey', icon_class: "icons-pie"
available_for "users"
active_for_controllers (['admin/surveys'])
head_link_path "admin_surveys_path"
context_link 'list_',
:link_path=>"admin_surveys_path" ,
:priority=>1,
:active_for_action=>{'admin/surveys'=>'index'},
:available_for => 'users'
context_link 'new_',
:link_path=>"new_admin_survey_path" ,
:priority=>2,
:active_for_action=>{'admin/surveys'=>'new'},
:available_for => 'sub_managers'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'survey').id}",
:priority=>3,
:active_for_action=>{'admin/surveys'=>'categories'},
:active_for_category => 'Survey',
:available_for => 'managers'
end
end
end
end
end
end