0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/templates/settings/users/index.hbs
Robert Jackson a1ed9adf92
Remove ObjectController proxying behavior.
Ember.ObjectController (and Ember.ArrayController) will be deprecated in
Ember 1.11 (and removed from core in Ember 2.0). The reasoning is
detailed in the Ember 2.0 RFC.

This PR does the following:

* Updates templates/controllers/views to explicitly reference model
  properties (instead of relying on proxying behavior).
* Clearly delineate where certain properties are being set or retrieved
  from (for example it was not clear exactly where `scratch` and
  `titleScratch` were stored).
* Remove usage of `Ember.ObjectController`.
* Add JSCS rule to prevent future PR's from adding regressions.
2015-01-01 21:51:20 -05:00

77 lines
3 KiB
Handlebars

{{#view "settings/users/users-list-view" class="users-list-wrapper js-users-list-view"}}
<header class="settings-view-header user-list-header">
{{#if session.user.isEditor}}
{{#link-to "content" class="btn btn-default btn-back"}}Back{{/link-to}}
{{else}}
{{#link-to "settings" class="btn btn-default btn-back"}}Back{{/link-to}}
{{/if}}
<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>
<section class="content settings-users">
{{#if invitedUsers}}
<section class="user-list invited-users">
<h4 class="user-list-title">Invited users</h4>
{{#each user in invitedUsers itemController="settings/users/user"}}
<div class="user-list-item">
<span class="user-list-item-icon icon-mail">ic</span>
<div class="user-list-item-body">
<span class="name">{{user.email}}</span><br>
{{#if user.model.pending}}
<span class="red">Invitation not sent - please try again</span>
{{else}}
<span class="description">Invitation sent: {{user.model.created_at}}</span>
{{/if}}
</div>
<aside class="user-list-item-aside">
<a class="user-list-action" href="#" {{action "revoke"}}>Revoke</a>
<a class="user-list-action" href="#" {{action "resend"}}>Resend</a>
</aside>
</div>
{{/each}}
</section>
{{/if}}
<section class="user-list active-users">
<h4 class="user-list-title">Active users</h4>
{{#each user in activeUsers itemController="settings/users/user"}}
{{#link-to 'settings.users.user' user class="user-list-item" }}
<span class="user-list-item-figure" {{bind-attr style=user.image}}>
<span class="hidden">Photo of {{unbound user.model.name}}</span>
</span>
<div class="user-list-item-body">
<span class="name">
{{user.model.name}}
</span>
<br>
<span class="description">Last seen: {{unbound user.last_login}}</span>
</div>
<aside class="user-list-item-aside">
{{#unless user.model.isAuthor}}
{{#each role in user.model.roles}}
<span class="role-label {{unbound role.lowerCaseName}}">{{role.name}}</span>
{{/each}}
{{/unless}}
</aside>
{{/link-to}}
{{/each}}
</section>
</section>{{! .content settings-users }}
{{/view}}