mirror of
https://github.com/discourse/discourse.git
synced 2025-06-24 00:21:33 +08:00

Change branding page into logo and fonts. In addition, icon for email setting and email appearance were changed.
34 lines
1.1 KiB
Ruby
34 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
class Admin::Config::FontsController < Admin::AdminController
|
|
def update
|
|
SiteSetting::Update.call(
|
|
guardian:,
|
|
params: {
|
|
settings: [
|
|
{ setting_name: "base_font", value: params[:base_font] },
|
|
{ setting_name: "heading_font", value: params[:heading_font] },
|
|
{
|
|
setting_name: "default_text_size",
|
|
value: params[:default_text_size],
|
|
backfill: params[:update_existing_users] == "true",
|
|
},
|
|
],
|
|
},
|
|
) do
|
|
on_success { render json: success_json }
|
|
on_failed_policy(:settings_are_visible) do |policy|
|
|
raise Discourse::InvalidParameters, policy.reason
|
|
end
|
|
on_failed_policy(:settings_are_unshadowed_globally) do |policy|
|
|
raise Discourse::InvalidParameters, policy.reason
|
|
end
|
|
on_failed_policy(:settings_are_configurable) do |policy|
|
|
raise Discourse::InvalidParameters, policy.reason
|
|
end
|
|
on_failed_policy(:values_are_valid) do |policy|
|
|
raise Discourse::InvalidParameters, policy.reason
|
|
end
|
|
end
|
|
end
|
|
end
|