0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Set up Design settings screen

refs https://github.com/TryGhost/Team/issues/1045

- added blank `/settings/design` route and associated screen
  - redirects to settings index if associated labs flag is not enabled
- when custom theme settings labs flag is enabled, replaced Branding and Theme links with single Design link
This commit is contained in:
Kevin Ansfield 2021-09-14 18:48:26 +01:00
parent e795692e6b
commit 667506b166
5 changed files with 69 additions and 14 deletions

View file

@ -0,0 +1,4 @@
import Controller from '@ember/controller';
export default class SettingsDesignController extends Controller {
}

View file

@ -52,6 +52,8 @@ Router.map(function () {
this.route('settings.members-email', {path: '/settings/members-email'});
this.route('settings.code-injection', {path: '/settings/code-injection'});
this.route('settings.design', {path: '/settings/design'});
// this.route('settings.products', {path: '/settings/products'});
// this.route('settings.product.new', {path: '/settings/product/new'});
// this.route('settings.product', {path: '/settings/product/:product_id'});

View file

@ -0,0 +1,24 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import {inject as service} from '@ember/service';
export default class DashboardRoute extends AuthenticatedRoute {
@service feature;
beforeModel() {
super.beforeModel(...arguments);
if (!this.session.user.isAdmin) {
return this.transitionTo('site');
}
if (!this.feature.customThemeSettings) {
return this.transitionTo('settings');
}
}
buildRouteInfoMetadata() {
return {
mainClasses: ['gh-main-wide']
};
}
}

View file

@ -15,20 +15,30 @@
<p>Basic publication details and site metadata</p>
</div>
</LinkTo>
<button type="button" class="gh-setting-group" {{action (toggle "showBrandingModal" this)}} data-test-nav="branding">
<span class="blue">{{svg-jar "paint-palette"}}</span>
<div>
<h4>Branding</h4>
<p>Upload site logo and set accent color</p>
</div>
</button>
<LinkTo class="gh-setting-group" @route="settings.theme" data-test-nav="theme">
<span class="green">{{svg-jar "view-site"}}</span>
<div>
<h4>Theme</h4>
<p>Install and update themes</p>
</div>
</LinkTo>
{{#if (feature "customThemeSettings")}}
<LinkTo class="gh-setting-group" @route="settings.design" data-test-nav="design">
<span class="blue">{{svg-jar "paint-palette"}}</span>
<div>
<h4>Design</h4>
<p>Make things pretty (CHANGEME)</p>
</div>
</LinkTo>
{{else}}
<button type="button" class="gh-setting-group" {{action (toggle "showBrandingModal" this)}} data-test-nav="branding">
<span class="blue">{{svg-jar "paint-palette"}}</span>
<div>
<h4>Branding</h4>
<p>Upload site logo and set accent color</p>
</div>
</button>
<LinkTo class="gh-setting-group" @route="settings.theme" data-test-nav="theme">
<span class="green">{{svg-jar "view-site"}}</span>
<div>
<h4>Theme</h4>
<p>Install and update themes</p>
</div>
</LinkTo>
{{/if}}
<LinkTo class="gh-setting-group" @route="settings.navigation" data-test-nav="navigation">
<span class="pink">{{svg-jar "compass-2"}}</span>
<div>

View file

@ -0,0 +1,15 @@
<section class="gh-canvas">
<GhCanvasHeader class="gh-canvas-header">
<h2 class="gh-canvas-title" data-test-screen-title>
<LinkTo @route="settings">Settings</LinkTo>
<span>{{svg-jar "arrow-right"}}</span>
Design
</h2>
</GhCanvasHeader>
<section class="view-container">
</section>
</section>
{{outlet}}