mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 06:03:43 +08:00
DEV: Fetch settings by area name instead of individual settings (#29604)
This commit switches the route for the about config page to retrieve the list of site settings that control the /about page by their area instead of their individual names. Internal topic: t/136384.
This commit is contained in:
parent
7d9d98422c
commit
ae721bd0f1
|
@ -5,21 +5,7 @@ export default class AdminConfigAboutRoute extends Route {
|
||||||
model() {
|
model() {
|
||||||
return ajax("/admin/config/site_settings.json", {
|
return ajax("/admin/config/site_settings.json", {
|
||||||
data: {
|
data: {
|
||||||
filter_names: [
|
filter_area: "about",
|
||||||
"title",
|
|
||||||
"site_description",
|
|
||||||
"extended_site_description",
|
|
||||||
"short_site_description",
|
|
||||||
"about_banner_image",
|
|
||||||
"community_owner",
|
|
||||||
"contact_email",
|
|
||||||
"contact_url",
|
|
||||||
"site_contact_username",
|
|
||||||
"site_contact_group_name",
|
|
||||||
"company_name",
|
|
||||||
"governing_law",
|
|
||||||
"city_for_disputes",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class SiteSetting < ActiveRecord::Base
|
class SiteSetting < ActiveRecord::Base
|
||||||
VALID_AREAS = %w[flags]
|
VALID_AREAS = %w[flags about]
|
||||||
|
|
||||||
extend GlobalPath
|
extend GlobalPath
|
||||||
extend SiteSettingExtension
|
extend SiteSettingExtension
|
||||||
|
|
|
@ -42,25 +42,32 @@ required:
|
||||||
title:
|
title:
|
||||||
client: true
|
client: true
|
||||||
default: "Discourse"
|
default: "Discourse"
|
||||||
|
area: "about"
|
||||||
site_description:
|
site_description:
|
||||||
default: ""
|
default: ""
|
||||||
|
area: "about"
|
||||||
short_site_description:
|
short_site_description:
|
||||||
default: ""
|
default: ""
|
||||||
client: true
|
client: true
|
||||||
|
area: "about"
|
||||||
contact_email:
|
contact_email:
|
||||||
default: ""
|
default: ""
|
||||||
type: email
|
type: email
|
||||||
|
area: "about"
|
||||||
contact_url:
|
contact_url:
|
||||||
default: ""
|
default: ""
|
||||||
|
area: "about"
|
||||||
notification_email:
|
notification_email:
|
||||||
default: "noreply@unconfigured.discourse.org"
|
default: "noreply@unconfigured.discourse.org"
|
||||||
type: email
|
type: email
|
||||||
site_contact_username:
|
site_contact_username:
|
||||||
default: ""
|
default: ""
|
||||||
type: username
|
type: username
|
||||||
|
area: "about"
|
||||||
site_contact_group_name:
|
site_contact_group_name:
|
||||||
default: ""
|
default: ""
|
||||||
type: group
|
type: group
|
||||||
|
area: "about"
|
||||||
exclude_rel_nofollow_domains:
|
exclude_rel_nofollow_domains:
|
||||||
client: true
|
client: true
|
||||||
default: ""
|
default: ""
|
||||||
|
@ -68,10 +75,13 @@ required:
|
||||||
list_type: simple
|
list_type: simple
|
||||||
company_name:
|
company_name:
|
||||||
default: ""
|
default: ""
|
||||||
|
area: "about"
|
||||||
governing_law:
|
governing_law:
|
||||||
default: ""
|
default: ""
|
||||||
|
area: "about"
|
||||||
city_for_disputes:
|
city_for_disputes:
|
||||||
default: ""
|
default: ""
|
||||||
|
area: "about"
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
logo:
|
logo:
|
||||||
|
@ -414,6 +424,7 @@ basic:
|
||||||
default: ""
|
default: ""
|
||||||
max: 10_000
|
max: 10_000
|
||||||
hidden: true
|
hidden: true
|
||||||
|
area: "about"
|
||||||
extended_site_description_cooked:
|
extended_site_description_cooked:
|
||||||
default: ""
|
default: ""
|
||||||
hidden: true
|
hidden: true
|
||||||
|
@ -422,10 +433,12 @@ basic:
|
||||||
default: ""
|
default: ""
|
||||||
type: upload
|
type: upload
|
||||||
hidden: true
|
hidden: true
|
||||||
|
area: "about"
|
||||||
community_owner:
|
community_owner:
|
||||||
default: ""
|
default: ""
|
||||||
max: 300
|
max: 300
|
||||||
hidden: true
|
hidden: true
|
||||||
|
area: "about"
|
||||||
use_legacy_pageviews:
|
use_legacy_pageviews:
|
||||||
default: false
|
default: false
|
||||||
hidden: true
|
hidden: true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user