mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
* FEATURE: Ability to add components to all themes This is the first and functional step from that topic https://dev.discourse.org/t/adding-a-theme-component-is-too-much-work/15398/16 The idea here is that when a new component is added, the user can easily assign it to all themes (parents). To achieve that, I needed to change a site-setting component to accept `setDefaultValues` action and `setDefaultValuesLabel` translated label. Also, I needed to add `allowAny` option to disable that for theme selector. I also refactored backend to accept both parent and child ids with one method to avoid duplication (Renamed `add_child_theme!` to more general `add_relative_theme!`) * FIX: Improvement after code review * FIX: Improvement after code review2 * FIX: use mapBy and filterBy directly
21 lines
837 B
Handlebars
21 lines
837 B
Handlebars
<div class='setting-label'>
|
|
<h3>{{unbound settingName}}</h3>
|
|
{{#if setting.defaultValues }}
|
|
<a onClick={{action 'setDefaultValues'}}>{{setting.setDefaultValuesLabel}}</a>
|
|
{{/if}}
|
|
</div>
|
|
<div class="setting-value">
|
|
{{component componentName setting=setting value=buffered.value validationMessage=validationMessage preview=preview isSecret=isSecret allowAny=allowAny}}
|
|
</div>
|
|
{{#if dirty}}
|
|
<div class='setting-controls'>
|
|
{{d-button class="ok" action=(action "update") icon="check"}}
|
|
{{d-button class="cancel" action=(action "cancel") icon="times"}}
|
|
</div>
|
|
{{else if setting.overridden}}
|
|
{{#if setting.secret}}
|
|
{{d-button action=(action "toggleSecret") icon="far-eye-slash"}}
|
|
{{/if}}
|
|
{{d-button class="btn-default undo" action=(action "resetDefault") icon="undo" label="admin.settings.reset"}}
|
|
{{/if}}
|