mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 16:03:41 +08:00
94b09f3331
Why this change? The `/admin/customize/themes/:id/schema/name` route is a work in progress but we want to be able to start navigating to it from the `/admin/customize/themes/:id` route. What does this change do? 1. Move `adminCustomizeThemes.schema` to a child route of `adminCustomizeThemes.show`. This is because we need the model from the parent route and if it isn't a child route we end up having to load the theme model again from the server. 1. Add the `objects_schema` attribute to `ThemeSettingsSerializer` 1. Refactor `SiteSettingComponent` to be able to render a button so that we don't have to hardcode the button rendering into the `SiteSettings::String` component
65 lines
1.6 KiB
Handlebars
65 lines
1.6 KiB
Handlebars
<div class="setting-label">
|
|
<h3>
|
|
{{this.settingName}}
|
|
|
|
{{#if this.staffLogFilter}}
|
|
<LinkTo
|
|
@route="adminLogs.staffActionLogs"
|
|
@query={{hash filters=this.staffLogFilter force_refresh=true}}
|
|
title={{i18n "admin.settings.history"}}
|
|
>
|
|
<span class="history-icon">
|
|
{{d-icon "history"}}
|
|
</span>
|
|
</LinkTo>
|
|
{{/if}}
|
|
</h3>
|
|
|
|
{{#if this.defaultIsAvailable}}
|
|
<DButton
|
|
class="btn-link"
|
|
@action={{this.setDefaultValues}}
|
|
@translatedLabel={{this.setting.setDefaultValuesLabel}}
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
|
|
<div class="setting-value">
|
|
{{#if this.settingEditButton}}
|
|
<DButton
|
|
@action={{this.settingEditButton.action}}
|
|
@icon={{this.settingEditButton.icon}}
|
|
@label={{this.settingEditButton.label}}
|
|
class="setting-value-edit-button"
|
|
/>
|
|
{{else}}
|
|
{{component
|
|
this.componentName
|
|
setting=this.setting
|
|
value=this.buffered.value
|
|
validationMessage=this.validationMessage
|
|
preview=this.preview
|
|
isSecret=this.isSecret
|
|
allowAny=this.allowAny
|
|
changeValueCallback=this.changeValueCallback
|
|
}}
|
|
{{/if}}
|
|
</div>
|
|
|
|
{{#if this.dirty}}
|
|
<div class="setting-controls">
|
|
<DButton class="ok" @action={{this.update}} @icon="check" />
|
|
<DButton class="cancel" @action={{this.cancel}} @icon="times" />
|
|
</div>
|
|
{{else if this.setting.overridden}}
|
|
{{#if this.setting.secret}}
|
|
<DButton @action={{this.toggleSecret}} @icon="far-eye-slash" />
|
|
{{/if}}
|
|
|
|
<DButton
|
|
class="btn-default undo"
|
|
@action={{this.resetDefault}}
|
|
@icon="undo"
|
|
@label="admin.settings.reset"
|
|
/>
|
|
{{/if}} |