forked from akiko-pusu/redmine_banner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
47 lines (42 loc) · 1.57 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
38
39
40
41
42
43
44
45
46
47
require 'redmine'
require 'banner_application_hooks'
require 'settings_controller_patch'
require 'banner_projects_helper_patch'
Redmine::Plugin.register :redmine_banner do
name 'Redmine Banner plugin'
author 'Akiko Takano'
author_url 'http://twitter.com/akiko_pusu'
description 'Plugin to show site-wide message, such as maintenacne informations or notifications.'
version '0.0.9'
requires_redmine :version_or_higher => '2.1.0'
url 'https://github.com/akiko-pusu/redmine_banner'
settings :partial => 'settings/redmine_banner',
:default => {
'enable' => 'false',
'banner_description' => 'exp. Information about upcoming Service Interruption.',
'type' => 'info',
'display_part' => 'both',
'use_timer' => 'false',
'start_ymd' => nil,
'start_hour' => nil,
'start_min' => nil,
'end_ymd' => nil,
'end_hour' => nil,
'end_min' => nil
}
menu :admin_menu, :redmine_banner, { :controller => 'settings',
:action => 'plugin', :id => :redmine_banner }, :caption => :banner
project_module :banner do
permission :manage_banner,
{:banner => [:show, :edit, :project_banner_off]}, :require => :member
end
Rails.configuration.to_prepare do
require_dependency 'projects_helper'
unless SettingsController.included_modules.include?(SettingsControllerPatch)
SettingsController.send(:include, SettingsControllerPatch)
end
unless ProjectsHelper.included_modules.include? BannerProjectsHelperPatch
ProjectsHelper.send(:include, BannerProjectsHelperPatch)
end
end
end