-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.rb
42 lines (34 loc) · 1.18 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
require 'redmine'
WINDOWS_DEFAULT_PATH = 'C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe'
NIX_DEFAUL_PATH = '/usr/local/bin/wkhtmltopdf'
if RUBY_PLATFORM =~ /(win|w)32$/
WKHTMLTOPDF_PATH = WINDOWS_DEFAULT_PATH
else
WKHTMLTOPDF_PATH = NIX_DEFAUL_PATH
end
WKHTMLTOPDF_PATH =
unless Redmine::Plugin.registered_plugins.keys.include?(:awesome_manuals)
Redmine::Plugin.register :awesome_manuals do
name 'Awesome Redmine PDF Documentation plugin'
author 'Nikita Vasiliev'
author_url 'mailto:[email protected]'
description 'Redmine plugin, which help to create pdf documentation'
version '0.0.1'
# Redmine Version
requires_redmine :version_or_higher => '1.3.0'
# Settings
settings :default => {:wkhtmltopdf_bin => WKHTMLTOPDF_PATH},
:partial => "awesome_manuals/settings"
=begin // Permissions not working, because Redmine is project-oriented
permission :edit_manuals, {
:manuals => [:edit, :destroy],
:manual_chapters => [:edit, :destroy]
}
permission :generate_manuals, {
:manuals => [:generate]
}
=end
# Menu
menu :top_menu, :awesome_manuals, { :controller => 'manuals', :action => 'index' }, :caption => :manuals
end
end