mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Updated profile page for Authors & Contributors
No ref - Removed breadcrumbs when profile page is loading - Redirected Authors and Contributors to profile page when accessing /staff
This commit is contained in:
parent
941d4de4af
commit
c5940ab57b
3 changed files with 32 additions and 7 deletions
10
ghost/admin/app/controllers/settings/staff/user-loading.js
Normal file
10
ghost/admin/app/controllers/settings/staff/user-loading.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import Controller from '@ember/controller';
|
||||
import {alias} from '@ember/object/computed';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
session: service(),
|
||||
|
||||
user: alias('model'),
|
||||
currentUser: alias('session.user')
|
||||
});
|
|
@ -6,6 +6,16 @@ export default class IndexRoute extends AuthenticatedRoute {
|
|||
@service infinity;
|
||||
@service session;
|
||||
|
||||
beforeModel() {
|
||||
super.beforeModel(...arguments);
|
||||
|
||||
const user = this.session.user;
|
||||
|
||||
if (!user.isAdmin) {
|
||||
return this.transitionTo('settings.staff.user', user);
|
||||
}
|
||||
}
|
||||
|
||||
model() {
|
||||
return this.session.user;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<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>
|
||||
<LinkTo @route="settings.staff" data-test-staff-link={{true}}>Staff</LinkTo>
|
||||
<span>{{svg-jar "arrow-right"}}</span>
|
||||
{{this.user.name}}
|
||||
</h2>
|
||||
{{!-- Remove breadcrumbs for Authors and Contributors --}}
|
||||
{{#if this.currentUser.isAuthorOrContributor}}
|
||||
<h2 class="gh-canvas-title" data-test-screen-title>Your profile</h2>
|
||||
{{else}}
|
||||
<h2 class="gh-canvas-title" data-test-screen-title>
|
||||
<LinkTo @route="settings">Settings</LinkTo>
|
||||
<span>{{svg-jar "arrow-right"}}</span>
|
||||
<LinkTo @route="settings.staff" data-test-staff-link={{true}}>Staff</LinkTo>
|
||||
<span>{{svg-jar "arrow-right"}}</span>
|
||||
{{this.user.name}}
|
||||
</h2>
|
||||
{{/if}}
|
||||
|
||||
<section class="view-actions">
|
||||
<div class="gh-btn gh-btn-primary"><span>Save</span></div>
|
||||
|
|
Loading…
Add table
Reference in a new issue