2021-04-18 14:34:55 +03:00
# frozen_string_literal: true
2017-06-07 20:23:20 +03:00
Redmine :: Plugin . register :additionals do
name 'Additionals'
2013-11-11 14:57:30 +04:00
author 'AlphaNodes GmbH'
2017-06-07 20:23:20 +03:00
description 'Customizing Redmine, providing wiki macros and act as a library/function provider for other Redmine plugins'
2020-11-29 15:17:02 +03:00
version Additionals :: VERSION
2015-01-11 18:48:15 +03:00
author_url 'https://alphanodes.com/'
2017-06-07 20:23:20 +03:00
url 'https://github.com/alphanodes/additionals'
2020-11-29 15:17:02 +03:00
directory __dir__
2013-11-11 14:57:30 +04:00
2017-07-26 12:01:51 +03:00
default_settings = Additionals . load_settings
2014-10-01 21:51:46 +04:00
5 . times do | i |
2020-08-06 09:18:30 +03:00
default_settings [ " custom_menu #{ i } _name " ] = ''
default_settings [ " custom_menu #{ i } _url " ] = ''
default_settings [ " custom_menu #{ i } _title " ] = ''
2014-10-01 21:51:46 +04:00
end
2021-04-18 14:34:55 +03:00
settings default : default_settings , partial : 'additionals/settings/additionals'
2016-12-02 14:45:12 +03:00
permission :show_hidden_roles_in_memberbox , { }
2020-07-27 11:49:23 +03:00
permission :set_system_dashboards ,
{ } ,
require : :loggedin ,
read : true
2020-08-07 19:10:18 +03:00
permission :share_dashboards ,
2020-07-27 11:49:23 +03:00
{ dashboards : % i [ index new create edit update destroy ] } ,
require : :member ,
read : true
permission :save_dashboards ,
{ dashboards : % i [ index new create edit update destroy ] } ,
require : :loggedin ,
read : true
2016-12-02 14:45:12 +03:00
project_module :issue_tracking do
permission :edit_closed_issues , { }
2017-07-26 12:01:51 +03:00
permission :edit_issue_author , { }
permission :change_new_issue_author , { }
2018-10-17 12:59:11 +03:00
permission :issue_timelog_never_required , { }
2016-12-02 14:45:12 +03:00
end
2013-11-11 14:57:30 +04:00
2016-12-05 17:47:53 +03:00
project_module :time_tracking do
permission :log_time_on_closed_issues , { }
end
2013-11-11 14:57:30 +04:00
# required redmine version
2020-07-27 11:49:23 +03:00
requires_redmine version_or_higher : '4.1'
2013-11-11 14:57:30 +04:00
2017-06-07 20:23:20 +03:00
menu :admin_menu , :additionals , { controller : 'settings' , action : 'plugin' , id : 'additionals' } , caption : :label_additionals
2013-11-11 14:57:30 +04:00
end
2018-02-12 16:53:05 +03:00
2020-04-15 15:57:09 +03:00
Rails . application . config . after_initialize do
2020-09-16 21:44:14 +03:00
# @TODO: this should be moved to AdditionalsFontAwesome and use an instance of it
FONTAWESOME_ICONS = { fab : AdditionalsFontAwesome . load_icons ( :fab ) , # rubocop: disable Lint/ConstantDefinitionInBlock
2020-04-15 15:57:09 +03:00
far : AdditionalsFontAwesome . load_icons ( :far ) ,
fas : AdditionalsFontAwesome . load_icons ( :fas ) } . freeze
end
Rails . application . paths [ 'app/overrides' ] || = [ ]
Dir . glob ( Rails . root . join ( 'plugins/*/app/overrides' ) ) . each do | dir |
2021-04-18 14:34:55 +03:00
Rails . application . paths [ 'app/overrides' ] << dir unless Rails . application . paths [ 'app/overrides' ] . include? dir
2018-02-12 16:53:05 +03:00
end
2020-11-29 15:17:02 +03:00
Rails . configuration . to_prepare do
Additionals . setup
end