-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.rb
32 lines (25 loc) · 1.26 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
require 'redmine'
require 'redmine_doodles/patch_redmine_classes'
require 'redmine_doodles/view_hooks'
Rails.configuration.to_prepare do
Project.send(:include, ::Plugin::Doodles::Project) unless Project.include?(::Plugin::Doodles::Project)
Mailer.send(:include, ::Plugin::Doodles::Mailer) unless Mailer.include?(::Plugin::Doodles::Mailer)
end
Redmine::Plugin.register :redmine_doodles do
name 'Redmine Doodles plugin'
author 'Felix Schäfer'
description 'Per project doodles'
version '1.0.0'
url 'https://orga.fachschaften.org/projects/redmine_doodles'
author_url 'http://orga.fachschaften.org/users/3'
requires_redmine '2.5'
project_module :doodles do
permission :manage_doodles, {doodles: [:lock, :edit, :update]}, require: :member
permission :delete_doodles, {doodles: [:destroy]}, require: :member
permission :create_doodles, {doodles: [:new, :create, :preview]}, require: :member
permission :answer_doodles, {doodle_answers: [:create, :update]}, require: :loggedin
permission :view_doodles, {doodles: [:index, :show]}
end
menu :project_menu, :doodles, {controller: 'doodles', action: 'index'}, caption: :label_doodle_plural, param: :project_id
activity_provider :doodles, default: false, class_name: ['Doodle', 'DoodleAnswersEdits']
end