-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.rb
37 lines (30 loc) · 1.14 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'redmine'
Redmine::Plugin.register :redmine_tour do
name 'Redmine Tour plugin'
author 'Jan Schulz-Hofen, Planio GmbH'
description 'Redmine tour for first-time users'
version '1.1.0'
settings :default => {
'app_name' => 'Planio',
'repo_host_base' => 'plan.io',
'help_uri' => 'http://plan.io/contact',
'repo_host' => nil,
'git_enabled' => true,
'svn_enabled' => true
}
end
# initialize hooks
class RedmineTourBaseHook < Redmine::Hook::ViewListener
render_on :view_layouts_base_before_content, :partial => 'tour/base'
end
class RedmineTourTabHook < Redmine::Hook::ViewListener
render_on :view_layouts_tab_before_content, :partial => 'tour/tab'
end
Redmine::MenuManager.map :top_menu do |menu|
help_uri = Setting.plugin_redmine_tour['help_uri'] rescue '#' # rescueing from case where settings table is not there yet during initial db:migrate
menu.delete :help
menu.push :tour, help_uri, :last => true, :html => {:onclick => 'return showTour();', :target => '_blank'}, :caption => :label_help
end
Dispatcher.to_prepare do
ApplicationHelper.send(:include, RedmineTour::Patches::ApplicationHelperPatch)
end