UX: Admin setting page consistency - Legal (#30572)

Followup c2282439b3

Make the Legal config page reached from the sidebar
use our consistent site setting page rules.
This commit is contained in:
Martin Brennan 2025-01-06 16:08:42 +10:00 committed by GitHub
parent 21470e4afd
commit 9a87baaab4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 53 additions and 9 deletions

View File

@ -0,0 +1,3 @@
import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base";
export default class AdminConfigLegalSettingsController extends AdminAreaSettingsBaseController {}

View File

@ -0,0 +1,8 @@
import DiscourseRoute from "discourse/routes/discourse";
import { i18n } from "discourse-i18n";
export default class AdminConfigLegalRoute extends DiscourseRoute {
titleToken() {
return i18n("admin.community.sidebar_link.legal");
}
}

View File

@ -231,6 +231,11 @@ export default function () {
path: "/",
});
});
this.route("legal", function () {
this.route("settings", {
path: "/",
});
});
this.route("trustLevels", { path: "/trust-levels" }, function () {
this.route("settings", {
path: "/",

View File

@ -0,0 +1,21 @@
<DPageHeader
@titleLabel={{i18n "admin.config.legal.title"}}
@descriptionLabel={{i18n "admin.config.legal.header_description"}}
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/config/legal"
@label={{i18n "admin.config.legal.title"}}
/>
</:breadcrumbs>
</DPageHeader>
<div class="admin-config-page__main-area">
<AdminAreaSettings
@area="legal"
@path="/admin/config/legal"
@filter={{this.filter}}
@adminSettingsFilterChangedCallback={{this.adminSettingsFilterChangedCallback}}
/>
</div>

View File

@ -79,9 +79,7 @@ export const ADMIN_NAV_MAP = [
},
{
name: "admin_legal",
route: "adminSiteSettingsCategory",
routeModels: ["legal"],
query: { filter: "" },
route: "adminConfig.legal.settings",
label: "admin.community.sidebar_link.legal",
icon: "gavel",
},

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class SiteSetting < ActiveRecord::Base
VALID_AREAS = %w[about embedding emojis flags fonts notifications permalinks]
VALID_AREAS = %w[about embedding emojis flags fonts legal notifications permalinks]
extend GlobalPath
extend SiteSettingExtension

View File

@ -5146,6 +5146,9 @@ en:
notifications:
title: "Notifications"
header_description: "Configure how notifications are managed and delivered for users, including email preferences, push notifications, mention limits, and notification consolidation."
legal:
title: "Legal"
header_description: "Configure legal settings, such as terms of service, privacy policy, contact details, and EU-specific considerations."
trust_levels:
title: "Trust levels"
header_description: "Trust level settings allow you to fine-tune the requirements and notifications for your communitys progression system, which automatically promotes users to higher trust levels as they demonstrate consistent, positive engagement with your forum."

View File

@ -397,6 +397,7 @@ Discourse::Application.routes.draw do
get "login-and-authentication" => "site_settings#index"
get "logo" => "site_settings#index"
get "notifications" => "site_settings#index"
get "legal" => "site_settings#index"
get "trust-levels" => "site_settings#index"
resources :flags, only: %i[index new create update destroy] do

View File

@ -53,10 +53,10 @@ required:
contact_email:
default: ""
type: email
area: "about|notifications"
area: "about|notifications|legal"
contact_url:
default: ""
area: "about"
area: "about|legal"
notification_email:
default: "noreply@unconfigured.discourse.org"
type: email
@ -75,13 +75,13 @@ required:
list_type: simple
company_name:
default: ""
area: "about"
area: "about|legal"
governing_law:
default: ""
area: "about"
area: "about|legal"
city_for_disputes:
default: ""
area: "about"
area: "about|legal"
branding:
logo:
@ -2564,17 +2564,22 @@ legal:
tos_url:
client: true
default: ""
area: "legal"
privacy_policy_url:
client: true
default: ""
area: "legal"
faq_url:
client: true
default: ""
area: "legal"
log_anonymizer_details:
default: true
area: "legal"
display_eu_visitor_stats:
default: false
client: true
area: "legal"
backups:
enable_backups: