2019-03-17 02:04:38 +00:00
|
|
|
# frozen_string_literal: true
|
2019-03-15 01:32:57 +00:00
|
|
|
|
2021-11-17 20:45:39 +00:00
|
|
|
require 'redmine/configuration'
|
|
|
|
|
require 'redmine/plugin_loader'
|
|
|
|
|
|
|
|
|
|
Rails.application.config.to_prepare do
|
2021-11-17 20:47:53 +00:00
|
|
|
I18n.backend = Redmine::I18n::Backend.new
|
|
|
|
|
# Forces I18n to load available locales from the backend
|
|
|
|
|
I18n.config.available_locales = nil
|
|
|
|
|
|
2024-01-11 06:16:17 +00:00
|
|
|
# Use Nokogiri as XML backend instead of Rexml
|
|
|
|
|
ActiveSupport::XmlMini.backend = 'Nokogiri'
|
|
|
|
|
|
2021-11-17 20:45:39 +00:00
|
|
|
Redmine::Preparation.prepare
|
|
|
|
|
end
|
2012-04-25 17:17:49 +00:00
|
|
|
|
2012-04-28 12:00:45 +00:00
|
|
|
# Load the secret token from the Redmine configuration file
|
|
|
|
|
secret = Redmine::Configuration['secret_token']
|
|
|
|
|
if secret.present?
|
|
|
|
|
RedmineApp::Application.config.secret_token = secret
|
|
|
|
|
end
|
|
|
|
|
|
2021-11-17 20:36:53 +00:00
|
|
|
Redmine::PluginLoader.load
|
2014-10-24 18:41:35 +00:00
|
|
|
|
|
|
|
|
Rails.application.config.to_prepare do
|
2024-01-25 05:38:33 +00:00
|
|
|
default_paths = []
|
|
|
|
|
default_paths << Rails.public_path.join('javascripts')
|
|
|
|
|
default_paths << Rails.public_path.join('stylesheets')
|
|
|
|
|
default_paths << Rails.public_path.join('images')
|
|
|
|
|
Rails.application.config.assets.redmine_default_asset_path = Redmine::AssetPath.new(Rails.public_path, default_paths)
|
|
|
|
|
|
2014-10-24 18:41:35 +00:00
|
|
|
Redmine::FieldFormat::RecordList.subclasses.each do |klass|
|
|
|
|
|
klass.instance.reset_target_class
|
|
|
|
|
end
|
2019-05-27 08:53:49 +00:00
|
|
|
|
2024-01-25 05:38:33 +00:00
|
|
|
Redmine::Plugin.all.each do |plugin|
|
|
|
|
|
paths = plugin.asset_paths
|
|
|
|
|
Rails.application.config.assets.redmine_extension_paths << paths if paths.present?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Redmine::Themes.themes.each do |theme|
|
|
|
|
|
paths = theme.asset_paths
|
|
|
|
|
Rails.application.config.assets.redmine_extension_paths << paths if paths.present?
|
|
|
|
|
end
|
2015-08-05 08:27:10 +00:00
|
|
|
end
|