From 5463b845e3a58080e4f996f1d554adb5c5222f94 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 6 Jan 2025 15:45:19 +1100 Subject: [PATCH] UX: Admin setting page consistency - Site Logo (#30567) Create a basic config page that only contains site logo settings, to replace the "branding" category linked to from "Site logo" in the admin sidebar. --- .../controllers/admin-config-logo-settings.js | 3 +++ .../admin/addon/routes/admin-config-logo.js | 8 +++++++ .../admin/addon/routes/admin-route-map.js | 3 +++ .../addon/templates/config-logo-settings.hbs | 21 +++++++++++++++++++ .../app/lib/sidebar/admin-nav-map.js | 4 +--- config/locales/client.en.yml | 3 +++ config/routes.rb | 1 + 7 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/admin/addon/controllers/admin-config-logo-settings.js create mode 100644 app/assets/javascripts/admin/addon/routes/admin-config-logo.js create mode 100644 app/assets/javascripts/admin/addon/templates/config-logo-settings.hbs diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-logo-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-config-logo-settings.js new file mode 100644 index 00000000000..b3ac39ad4a7 --- /dev/null +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-logo-settings.js @@ -0,0 +1,3 @@ +import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base"; + +export default class AdminConfigLogoSettingsController extends AdminAreaSettingsBaseController {} diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-logo.js b/app/assets/javascripts/admin/addon/routes/admin-config-logo.js new file mode 100644 index 00000000000..2c8548a5f4e --- /dev/null +++ b/app/assets/javascripts/admin/addon/routes/admin-config-logo.js @@ -0,0 +1,8 @@ +import DiscourseRoute from "discourse/routes/discourse"; +import { i18n } from "discourse-i18n"; + +export default class AdminConfigLogoRoute extends DiscourseRoute { + titleToken() { + return i18n("admin.appearance.sidebar_link.site_logo"); + } +} diff --git a/app/assets/javascripts/admin/addon/routes/admin-route-map.js b/app/assets/javascripts/admin/addon/routes/admin-route-map.js index e9136b0f770..c10775f5fca 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js +++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js @@ -265,6 +265,9 @@ export default function () { this.route("fonts", function () { this.route("settings", { path: "/" }); }); + this.route("logo", function () { + this.route("settings", { path: "/" }); + }); } ); diff --git a/app/assets/javascripts/admin/addon/templates/config-logo-settings.hbs b/app/assets/javascripts/admin/addon/templates/config-logo-settings.hbs new file mode 100644 index 00000000000..ebe1a00209e --- /dev/null +++ b/app/assets/javascripts/admin/addon/templates/config-logo-settings.hbs @@ -0,0 +1,21 @@ + + <:breadcrumbs> + + + + + +
+ +
\ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js b/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js index 525536006da..2246c33de0e 100644 --- a/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js +++ b/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js @@ -108,9 +108,7 @@ export const ADMIN_NAV_MAP = [ }, { name: "admin_site_logo", - route: "adminSiteSettingsCategory", - routeModels: ["branding"], - query: { filter: "" }, + route: "adminConfig.logo.settings", label: "admin.appearance.sidebar_link.site_logo", icon: "fab-discourse", }, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index eb35275381a..e3ec31de863 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5140,6 +5140,9 @@ en: login_and_authentication: title: "Login and authentication" header_description: "Configure how users log in and authenticate, secrets and keys, OAuth2 providers, and more." + logo: + title: "Site logo" + header_description: "Customize the variations of your site logo." notifications: title: "Notifications" header_description: "Configure how notifications are managed and delivered for users, including email preferences, push notifications, mention limits, and notification consolidation." diff --git a/config/routes.rb b/config/routes.rb index 08e82408258..d92ecf6adee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -395,6 +395,7 @@ Discourse::Application.routes.draw do get "fonts" => "site_settings#index" get "login-and-authentication" => "site_settings#index" + get "logo" => "site_settings#index" get "notifications" => "site_settings#index" resources :flags, only: %i[index new create update destroy] do