mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-05 18:34:39 +03:00
parent
d38e22d32a
commit
52a1b22070
@ -4,6 +4,15 @@
|
||||
// Slug: /ghost/settings/users/
|
||||
// --------------------------------------------------
|
||||
|
||||
.user-list-header {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.content.settings-users {
|
||||
padding: 0 40px;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.invited-users {
|
||||
margin-bottom: 34px;
|
||||
|
@ -4,7 +4,7 @@ import styleBody from 'ghost/mixins/style-body';
|
||||
var paginationSettings = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
status: 'all'
|
||||
status: 'active'
|
||||
};
|
||||
|
||||
var UsersIndexRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, PaginationRouteMixin, {
|
||||
@ -17,16 +17,20 @@ var UsersIndexRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, sty
|
||||
|
||||
model: function () {
|
||||
var self = this;
|
||||
return this.store.find('user', 'me').then(function (currentUser) {
|
||||
if (currentUser.get('isEditor')) {
|
||||
// Editors only see authors in the list
|
||||
paginationSettings.role = 'Author';
|
||||
}
|
||||
return self.store.filter('user', paginationSettings, function (user) {
|
||||
|
||||
return self.store.find('user', {limit: 'all', status: 'invited'}).then(function () {
|
||||
return self.store.find('user', 'me').then(function (currentUser) {
|
||||
if (currentUser.get('isEditor')) {
|
||||
return user.get('isAuthor');
|
||||
// Editors only see authors in the list
|
||||
paginationSettings.role = 'Author';
|
||||
}
|
||||
return true;
|
||||
|
||||
return self.store.filter('user', paginationSettings, function (user) {
|
||||
if (currentUser.get('isEditor')) {
|
||||
return user.get('isAuthor');
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -1,12 +1,12 @@
|
||||
<header class="settings-view-header">
|
||||
{{#link-to "settings" class="btn btn-default btn-back"}}Back{{/link-to}}
|
||||
<h2 class="page-title">Users</h2>
|
||||
<section class="page-actions">
|
||||
<button class="btn btn-green" {{action "openModal" "invite-new-user"}} >New User</button>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
{{#view "settings/users/users-list-view" tagName="section" class="content settings-users" }}
|
||||
<header class="settings-view-header user-list-header">
|
||||
{{#link-to "settings" class="btn btn-default btn-back"}}Back{{/link-to}}
|
||||
<h2 class="page-title">Users</h2>
|
||||
<section class="page-actions">
|
||||
<button class="btn btn-green" {{action "openModal" "invite-new-user"}} >New User</button>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
{{#if invitedUsers}}
|
||||
|
||||
<section class="user-list invited-users">
|
||||
|
Loading…
Reference in New Issue
Block a user