tickets/lib/tickets/engine.rb

40 lines
1.3 KiB
Ruby

module Tickets
class Engine < ::Rails::Engine
initializer "tickets" do
OrbitApp.registration "Tickets", :type => "ModuleApp" do
module_label "tickets.tickets"
base_url File.expand_path File.dirname(__FILE__)
authorizable
taggable "Tickets"
categorizable
side_bar do
head_label_i18n 'tickets.tickets', icon_class: "icons-ticket"
available_for "users"
active_for_controllers (['admin/tickets'])
head_link_path "admin_tickets_path"
context_link 'tickets.all',
:link_path=>"admin_tickets_path" ,
:priority=>1,
:active_for_action=>{'admin/tickets'=>"index"},
:available_for => 'users'
context_link 'tickets.my_tickets',
:link_path=>"admin_tickets_my_tickets_path" ,
:priority=>2,
:active_for_action=>{'admin/tickets'=>"my_tickets"},
:available_for => 'users'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'ticket').id}",
:priority=>3,
:active_for_action=>{'admin/tickets'=>'categories'},
:active_for_category => 'Ticket',
:available_for => 'managers'
end
end
end
end
end