Actualizar plugin Additionals a 3.0.0
This commit is contained in:
parent
3d976f1b3b
commit
a26f5567af
399 changed files with 70374 additions and 4093 deletions
|
@ -1,23 +1,35 @@
|
|||
require_dependency 'additionals'
|
||||
raise "\n\033[31madditionals requires ruby 2.4 or newer. Please update your ruby version.\033[0m" if RUBY_VERSION < '2.4'
|
||||
|
||||
Redmine::Plugin.register :additionals do
|
||||
name 'Additionals'
|
||||
author 'AlphaNodes GmbH'
|
||||
description 'Customizing Redmine, providing wiki macros and act as a library/function provider for other Redmine plugins'
|
||||
version '2.0.20'
|
||||
version '3.0.0'
|
||||
author_url 'https://alphanodes.com/'
|
||||
url 'https://github.com/alphanodes/additionals'
|
||||
|
||||
default_settings = Additionals.load_settings
|
||||
5.times do |i|
|
||||
default_settings['custom_menu' + i.to_s + '_name'] = ''
|
||||
default_settings['custom_menu' + i.to_s + '_url'] = ''
|
||||
default_settings['custom_menu' + i.to_s + '_title'] = ''
|
||||
default_settings["custom_menu#{i}_name"] = ''
|
||||
default_settings["custom_menu#{i}_url"] = ''
|
||||
default_settings["custom_menu#{i}_title"] = ''
|
||||
end
|
||||
|
||||
settings(default: default_settings, partial: 'additionals/settings/additionals')
|
||||
|
||||
permission :show_hidden_roles_in_memberbox, {}
|
||||
permission :set_system_dashboards,
|
||||
{},
|
||||
require: :loggedin,
|
||||
read: true
|
||||
permission :share_dashboards,
|
||||
{ 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
|
||||
|
||||
project_module :issue_tracking do
|
||||
permission :edit_closed_issues, {}
|
||||
|
@ -31,30 +43,23 @@ Redmine::Plugin.register :additionals do
|
|||
end
|
||||
|
||||
# required redmine version
|
||||
requires_redmine version_or_higher: '3.4.0'
|
||||
requires_redmine version_or_higher: '4.1'
|
||||
|
||||
menu :admin_menu, :additionals, { controller: 'settings', action: 'plugin', id: 'additionals' }, caption: :label_additionals
|
||||
|
||||
RedCloth3::ALLOWED_TAGS << 'div'
|
||||
end
|
||||
|
||||
begin
|
||||
if ActiveRecord::Base.connection.table_exists?(Setting.table_name)
|
||||
Rails.configuration.to_prepare do
|
||||
Additionals.setup
|
||||
end
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
FONTAWESOME_ICONS = { fab: AdditionalsFontAwesome.load_icons(:fab),
|
||||
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|
|
||||
Rails.application.paths['app/overrides'] << dir unless Rails.application.paths['app/overrides'].include?(dir)
|
||||
end
|
||||
end
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
Rails.logger.warn 'database not created yet'
|
||||
Rails.configuration.to_prepare do
|
||||
Additionals.setup
|
||||
end
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
# @TODO: this should be moved to AdditionalsFontAwesome and use an instance of it
|
||||
FONTAWESOME_ICONS = { fab: AdditionalsFontAwesome.load_icons(:fab), # rubocop: disable Lint/ConstantDefinitionInBlock
|
||||
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|
|
||||
Rails.application.paths['app/overrides'] << dir unless Rails.application.paths['app/overrides'].include?(dir)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue