forked from jcppkkk/redmine_stealth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
37 lines (30 loc) · 926 Bytes
/
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'
Rails.logger.info 'o=>Starting Redmine Stealth plugin for RedMine'
plugin_name = 'redmine_stealth'
Redmine::Plugin.register plugin_name.to_sym do
name 'Redmine Stealth Plugin'
author 'Riley Lynch, Restream'
description 'Enables users to disable Redmine email notifications ' +
'for their actions'
version '0.7.3'
url 'https://github.com/Restream' + plugin_name
if respond_to?(:author_url)
author_url 'http://github.com/teleological'
end
permission :toggle_stealth_mode, stealth: :toggle
menu :account_menu, :stealth, { controller: 'stealth', action: 'toggle' }, {
first: true,
if: ->(_) {
User.current.stealth_allowed?
},
caption: ->(_) {
RedmineStealth.status_label(User.current.stealth_mode_active?)
},
html: {
id: 'stealth_toggle',
remote: true,
method: :post
}
}
end
require plugin_name