mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "Merge branch 'master' of https://github.com/discourse/discourse"
This reverts commite62a85cf6f, reversing changes made to2660c2e21d.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
31
app/controllers/themes_controller.rb
Normal file
31
app/controllers/themes_controller.rb
Normal 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
|
||||
Reference in New Issue
Block a user