FEATURE: Add auto update field to themes (#11102)

Themes marked for auto update will be automatically updated when
Discourse is updated. This is triggered by discourse_docker or
docker_manager running Rake task 'themes:update'.
This commit is contained in:
Dan Ungureanu
2020-11-16 14:44:09 +02:00
committed by GitHub
parent 0853208d67
commit bc8423a1bf
8 changed files with 48 additions and 7 deletions

View File

@@ -35,6 +35,11 @@ export default Controller.extend({
childThemesNames: mapBy("model.childThemes", "name"),
extraFiles: filterBy("model.theme_fields", "target", "extra_js"),
@discourseComputed("model.component", "model.remote_theme")
showCheckboxes() {
return !this.model.component || this.model.remote_theme;
},
@discourseComputed("model.editedFields")
editedFieldsFormatted() {
const descriptions = [];
@@ -304,6 +309,10 @@ export default Controller.extend({
this.model.saveChanges("user_selectable");
},
applyAutoUpdateable() {
this.model.saveChanges("auto_update");
},
addChildTheme() {
let themeId = parseInt(this.selectedChildThemeId, 10);
let theme = this.allThemes.findBy("id", themeId);

View File

@@ -134,12 +134,17 @@
{{/if}}
</div>
{{#unless model.component}}
{{#if showCheckboxes}}
<div class="control-unit">
{{inline-edit-checkbox action=(action "applyDefault") labelKey="admin.customize.theme.is_default" checked=model.default}}
{{inline-edit-checkbox action=(action "applyUserSelectable") labelKey="admin.customize.theme.user_selectable" checked=model.user_selectable}}
{{#unless model.component}}
{{inline-edit-checkbox action=(action "applyDefault") labelKey="admin.customize.theme.is_default" checked=model.default}}
{{inline-edit-checkbox action=(action "applyUserSelectable") labelKey="admin.customize.theme.user_selectable" checked=model.user_selectable}}
{{/unless}}
{{#if model.remote_theme}}
{{inline-edit-checkbox action=(action "applyAutoUpdateable") labelKey="admin.customize.theme.auto_update" checked=model.auto_update}}
{{/if}}
</div>
{{/unless}}
{{/if}}
{{#unless model.component}}
{{#d-section class="form-horizontal theme settings control-unit"}}