mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Added current theme display to design screen nav sidebar
no issue - fetch themes in the background when sidebar is rendered in case they haven't been loaded so far (current screen design means the first time the nav bar is seen the themes are unlikely to have been loaded already) - added `activeTheme` getter to grab the active theme from the live themes list
This commit is contained in:
parent
f08bf3cd7a
commit
d8bdd45add
2 changed files with 13 additions and 1 deletions
|
@ -37,6 +37,9 @@
|
|||
</div>
|
||||
|
||||
<div class="gh-nav-bottom">
|
||||
<LinkTo class="gh-nav-design-tab" @route="settings.design.change-theme">{{svg-jar "settings"}}Change theme</LinkTo>
|
||||
<LinkTo class="gh-nav-design-tab flex-column" style="align-items: self-start" @route="settings.design.change-theme">
|
||||
<span class="db">{{svg-jar "settings"}}Change theme</span>
|
||||
<span class="db">Current: {{this.activeTheme.name}}{{#if this.activeTheme.package.version}} - V {{this.activeTheme.package.version}}{{/if}}</span>
|
||||
</LinkTo>
|
||||
</div>
|
||||
</section>
|
|
@ -9,9 +9,11 @@ export default class DesignMenuComponent extends Component {
|
|||
@service customThemeSettings;
|
||||
@service router;
|
||||
@service settings;
|
||||
@service store;
|
||||
@service themeManagement;
|
||||
|
||||
@tracked openSection = null;
|
||||
@tracked themes = this.store.peekAll('theme');
|
||||
|
||||
KNOWN_GROUPS = [{
|
||||
key: 'homepage',
|
||||
|
@ -27,6 +29,9 @@ export default class DesignMenuComponent extends Component {
|
|||
super(...arguments);
|
||||
this.fetchThemeSettingsTask.perform();
|
||||
this.themeManagement.updatePreviewHtmlTask.perform();
|
||||
|
||||
// fetch all themes in the background so we can show the active theme
|
||||
this.store.findAll('theme');
|
||||
}
|
||||
|
||||
get themeSettings() {
|
||||
|
@ -58,6 +63,10 @@ export default class DesignMenuComponent extends Component {
|
|||
return groups;
|
||||
}
|
||||
|
||||
get activeTheme() {
|
||||
return this.themes.findBy('active', true);
|
||||
}
|
||||
|
||||
@action
|
||||
toggleSection(section) {
|
||||
if (this.openSection === section) {
|
||||
|
|
Loading…
Add table
Reference in a new issue