Show all invited users and infinite scroll active

Closes #4239
This commit is contained in:
Jason Williams 2014-10-16 15:28:51 +00:00
parent d38e22d32a
commit 52a1b22070
3 changed files with 30 additions and 17 deletions

View File

@ -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;

View File

@ -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;
});
});
});
},

View File

@ -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&nbsp;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&nbsp;User</button>
</section>
</header>
{{#if invitedUsers}}
<section class="user-list invited-users">