mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
move arbitrary html content out of noscript and into the preloadstore
This commit is contained in:
@@ -191,6 +191,7 @@ class ApplicationController < ActionController::Base
|
||||
def preload_anonymous_data
|
||||
store_preloaded("site", Site.cached_json(guardian))
|
||||
store_preloaded("siteSettings", SiteSetting.client_settings_json)
|
||||
store_preloaded("htmlContent", html_content_json)
|
||||
end
|
||||
|
||||
def preload_current_user_data
|
||||
@@ -199,6 +200,13 @@ class ApplicationController < ActionController::Base
|
||||
store_preloaded("topicTrackingStates", MultiJson.dump(serializer))
|
||||
end
|
||||
|
||||
def html_content_json
|
||||
MultiJson.dump({
|
||||
top: SiteContent.content_for(:top),
|
||||
bottom: SiteContent.content_for(:bottom),
|
||||
})
|
||||
end
|
||||
|
||||
def render_json_error(obj)
|
||||
if obj.present?
|
||||
render json: MultiJson.dump(errors: obj.errors.full_messages), status: 422
|
||||
|
||||
Reference in New Issue
Block a user