FEATURE: Adds back button to theme editor (#11416)

This commit is contained in:
Joe
2020-12-08 07:54:44 +08:00
committed by GitHub
parent 70741766cb
commit 5ab6ef9765
3 changed files with 51 additions and 3 deletions
@@ -64,5 +64,9 @@ export default Controller.extend({
}
}
},
goBack() {
this.replaceRoute(this.showRouteName, this.model.id);
},
},
});
@@ -1,6 +1,21 @@
<div class="current-style {{if maximized "maximized"}}">
<div class="wrapper">
<h2>{{i18n "admin.customize.theme.edit_css_html"}} {{#link-to showRouteName model.id replace=true}}{{model.name}}{{/link-to}}</h2>
<div class="editor-information">
{{d-button
title="go_back"
action=(action "goBack")
icon="chevron-left"
class="btn-small editor-back-button"
}}
<span class="editor-theme-name-wrapper">
{{i18n "admin.customize.theme.edit_css_html"}}
{{#link-to showRouteName model.id replace=true class="editor-theme-name"
}}
{{model.name}}
{{/link-to}}
</span>
</div>
{{admin-theme-editor
theme=model
@@ -15,14 +30,24 @@
<div class="admin-footer">
<div class="status-actions">
{{#unless model.changed}}
<a href={{previewUrl}} rel="noopener noreferrer" title={{i18n "admin.customize.explain_preview"}} class="preview-link" target="_blank">
<a
href={{previewUrl}}
rel="noopener noreferrer"
title={{i18n "admin.customize.explain_preview"}}
class="preview-link"
target="_blank"
>
{{i18n "admin.customize.preview"}}
</a>
{{/unless}}
</div>
<div class="buttons">
{{#d-button action=(action "save") disabled=saveDisabled class="btn-primary"}}
{{#d-button
action=(action "save")
disabled=saveDisabled
class="btn-primary"
}}
{{saveButtonText}}
{{/d-button}}
</div>