This reverts commit e62a85cf6f, reversing
changes made to 2660c2e21d.
This commit is contained in:
Jeff Atwood
2020-05-22 20:25:56 -07:00
parent e62a85cf6f
commit 20780a1eee
236 changed files with 717 additions and 1033 deletions

View File

@@ -16,7 +16,7 @@ class AboutController < ApplicationController
render :index
end
format.json do
render_json_dump(AboutSerializer.new(@about, scope: guardian))
render_serialized(@about, AboutSerializer)
end
end
end

View File

@@ -331,13 +331,7 @@ class ListController < ApplicationController
params[:category] = @category.id.to_s
@description_meta = if @category.uncategorized?
I18n.t('category.uncategorized_description', locale: SiteSetting.default_locale)
else
@category.description_text
end
@description_meta = SiteSetting.site_description if @description_meta.blank?
@description_meta = @category.description_text
if !guardian.can_see?(@category)
if SiteSetting.detailed_404
raise Discourse::InvalidAccess

View File

@@ -0,0 +1,31 @@
# frozen_string_literal: true
class ThemesController < ::ApplicationController
def assets
theme_ids = params[:ids].to_s.split("-").map(&:to_i)
if params[:ids] == "default"
theme_ids = nil
else
raise Discourse::NotFound unless guardian.allow_themes?(theme_ids)
end
targets = view_context.mobile_view? ? [:mobile, :mobile_theme] : [:desktop, :desktop_theme]
targets << :admin if guardian.is_staff?
targets.append(*Discourse.find_plugin_css_assets(mobile_view: true, desktop_view: true))
object = targets.map do |target|
Stylesheet::Manager.stylesheet_data(target, theme_ids).map do |hash|
next hash unless Rails.env.development?
dup_hash = hash.dup
dup_hash[:new_href] = dup_hash[:new_href].dup
dup_hash[:new_href] << (dup_hash[:new_href].include?("?") ? "&" : "?")
dup_hash[:new_href] << SecureRandom.hex
dup_hash
end
end.flatten
render json: object.as_json
end
end