mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Merge pull request #4289 from jaswilli/issue-4239
Show all invited users and infinite scroll active
This commit is contained in:
commit
ddb6230d4e
3 changed files with 30 additions and 17 deletions
|
@ -4,6 +4,15 @@
|
||||||
// Slug: /ghost/settings/users/
|
// Slug: /ghost/settings/users/
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
.user-list-header {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content.settings-users {
|
||||||
|
padding: 0 40px;
|
||||||
|
overflow: auto;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.invited-users {
|
.invited-users {
|
||||||
margin-bottom: 34px;
|
margin-bottom: 34px;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import styleBody from 'ghost/mixins/style-body';
|
||||||
var paginationSettings = {
|
var paginationSettings = {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
status: 'all'
|
status: 'active'
|
||||||
};
|
};
|
||||||
|
|
||||||
var UsersIndexRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, PaginationRouteMixin, {
|
var UsersIndexRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, PaginationRouteMixin, {
|
||||||
|
@ -17,16 +17,20 @@ var UsersIndexRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, sty
|
||||||
|
|
||||||
model: function () {
|
model: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.store.find('user', 'me').then(function (currentUser) {
|
|
||||||
if (currentUser.get('isEditor')) {
|
return self.store.find('user', {limit: 'all', status: 'invited'}).then(function () {
|
||||||
// Editors only see authors in the list
|
return self.store.find('user', 'me').then(function (currentUser) {
|
||||||
paginationSettings.role = 'Author';
|
|
||||||
}
|
|
||||||
return self.store.filter('user', paginationSettings, function (user) {
|
|
||||||
if (currentUser.get('isEditor')) {
|
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" }}
|
{{#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}}
|
{{#if invitedUsers}}
|
||||||
|
|
||||||
<section class="user-list invited-users">
|
<section class="user-list invited-users">
|
||||||
|
|
Loading…
Add table
Reference in a new issue