Project

General

Profile

Feature #39111 » 0001-Add-asset-path-to-default-to-support-old-style-theme.patch

Takashi Kato, 2024-10-29 15:41

View differences:

config/initializers/30-redmine.rb
Rails.application.config.to_prepare do
default_paths = []
Rails.application.config.assets.redmine_default_asset_path = Redmine::AssetPath.new(Rails.public_path, default_paths)
default_paths << Rails.root.join("app/assets/javascripts")
default_paths << Rails.root.join("app/assets/images")
default_paths << Rails.root.join("app/assets/stylesheets")
Rails.application.config.assets.redmine_default_asset_path = Redmine::AssetPath.new(Rails.root.join('app/assets'), default_paths)
Redmine::FieldFormat::RecordList.subclasses.each do |klass|
klass.instance.reset_target_class
test/fixtures/themes/foo_theme/stylesheets/application.css
/* load the default Redmine stylesheet */
@import url(../../../stylesheets/application.css);
test/integration/lib/redmine/themes_test.rb
assert_response :success
assert_select 'body[class~="theme-Foo_bar_baz"]'
end
def test_old_theme_compatibility
@theme = Redmine::Themes::Theme.new(Rails.root.join('test/fixtures/themes/foo_theme'))
Rails.application.config.assets.redmine_extension_paths << @theme.asset_paths
Setting.ui_theme = @theme.id
Rails.application.assets.load_path.clear_cache
asset = Rails.application.assets.load_path.find('themes/foo_theme/application.css')
get "/assets/#{asset.digested_path.to_s}"
assert_response :success
assert_match %r{url\(\"/assets/application-\w+\.css\"\)}, response.body
end
end
(8-8/10)