mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
This reverts commita53d8d3e61
and105634435f
. Reverted because the change broke some components. Will be added back in a few days.
This commit is contained in:
@ -8,7 +8,7 @@ class ThemeJavascriptsController < ApplicationController
|
||||
:preload_json,
|
||||
:redirect_to_login_if_required,
|
||||
:verify_authenticity_token,
|
||||
only: [:show, :show_tests]
|
||||
only: [:show]
|
||||
)
|
||||
|
||||
before_action :is_asset_path, :no_cookies, :apply_cdn_headers, only: [:show]
|
||||
@ -34,29 +34,6 @@ class ThemeJavascriptsController < ApplicationController
|
||||
send_file(cache_file, disposition: :inline)
|
||||
end
|
||||
|
||||
def show_tests
|
||||
raise Discourse::NotFound if Rails.env.production?
|
||||
|
||||
theme_id = params.require(:theme_id)
|
||||
theme = Theme.find(theme_id)
|
||||
content = ThemeField
|
||||
.where(
|
||||
theme_id: theme_id,
|
||||
target_id: Theme.targets[:tests_js]
|
||||
)
|
||||
.each(&:ensure_baked!)
|
||||
.map(&:value_baked)
|
||||
.join("\n")
|
||||
|
||||
ThemeJavascriptCompiler.force_default_settings(content, theme)
|
||||
|
||||
response.headers["Content-Length"] = content.size.to_s
|
||||
response.headers["Last-Modified"] = Time.zone.now.httpdate
|
||||
immutable_for(1.second)
|
||||
|
||||
send_data content, filename: "js-tests-theme-#{theme_id}.js", disposition: :inline
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def query
|
||||
|
Reference in New Issue
Block a user