2017-02-16 18:12:13 +01:00
|
|
|
<section class="gh-canvas">
|
2019-06-18 12:47:21 +02:00
|
|
|
<GhCanvasHeader class="gh-canvas-header">
|
2019-02-22 10:43:35 +01:00
|
|
|
<h2 class="gh-canvas-title" data-test-screen-title>Staff users</h2>
|
2015-06-30 15:21:03 +02:00
|
|
|
{{!-- Do not show Invite user button to authors --}}
|
2019-01-14 15:50:30 +01:00
|
|
|
{{#unless currentUser.isAuthorOrContributor}}
|
2015-06-30 15:21:03 +02:00
|
|
|
<section class="view-actions">
|
2019-02-22 10:43:35 +01:00
|
|
|
<button class="gh-btn gh-btn-green" {{action "toggleInviteUserModal"}} ><span>Invite people</span></button>
|
2015-06-30 15:21:03 +02:00
|
|
|
</section>
|
|
|
|
{{/unless}}
|
2019-06-18 12:47:21 +02:00
|
|
|
</GhCanvasHeader>
|
2014-10-16 17:28:51 +02:00
|
|
|
|
2017-01-31 10:10:36 +01:00
|
|
|
{{#if showInviteUserModal}}
|
|
|
|
{{gh-fullscreen-modal "invite-new-user"
|
|
|
|
close=(action "toggleInviteUserModal")
|
2017-02-16 18:12:13 +01:00
|
|
|
modifier="action wide"}}
|
2017-01-31 10:10:36 +01:00
|
|
|
{{/if}}
|
|
|
|
|
2019-06-18 12:47:21 +02:00
|
|
|
<section class="view-container gh-team">
|
2017-02-16 18:12:13 +01:00
|
|
|
{{!-- Show invited users to everyone except authors --}}
|
2019-01-14 15:50:30 +01:00
|
|
|
{{#unless currentUser.isAuthorOrContributor}}
|
2017-02-16 18:12:13 +01:00
|
|
|
{{#if invites}}
|
2019-06-18 12:47:21 +02:00
|
|
|
<section class="apps-grid-container gh-invited-users apps-first-header" data-test-invited-users>
|
2017-02-16 18:12:13 +01:00
|
|
|
<span class="apps-grid-title">Invited users</span>
|
|
|
|
<div class="apps-grid">
|
|
|
|
|
|
|
|
{{#each sortedInvites as |invite|}}
|
2017-11-25 00:18:35 +01:00
|
|
|
{{#gh-user-invited invite=invite reload=(route-action "reload") as |component|}}
|
2017-02-17 10:59:57 +01:00
|
|
|
<div class="apps-grid-cell" data-test-invite-id="{{invite.id}}">
|
2017-02-16 18:12:13 +01:00
|
|
|
<article class="apps-card-app">
|
|
|
|
<div class="apps-card-left">
|
2018-03-19 10:57:31 +01:00
|
|
|
<span class="user-list-item-icon">{{svg-jar "email"}}ic</span>
|
2017-02-16 18:12:13 +01:00
|
|
|
<div class="apps-card-meta">
|
2017-02-17 10:59:57 +01:00
|
|
|
<h3 class="apps-card-app-title" data-test-email>{{invite.email}}</h3>
|
2017-02-16 18:12:13 +01:00
|
|
|
<p class="apps-card-app-desc">
|
|
|
|
{{#if invite.pending}}
|
|
|
|
<span class="description-error">
|
|
|
|
Invitation not sent - please try again
|
|
|
|
</span>
|
|
|
|
{{else}}
|
2017-02-27 14:11:39 +01:00
|
|
|
<span class="description" data-test-invite-description>
|
2017-02-16 18:12:13 +01:00
|
|
|
Invitation sent: {{component.createdAt}},
|
2017-02-27 14:11:39 +01:00
|
|
|
{{if component.isExpired "expired" "expires"}} {{component.expiresAt}}
|
2017-02-16 18:12:13 +01:00
|
|
|
</span>
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
</div>
|
2015-06-30 15:21:03 +02:00
|
|
|
</div>
|
2017-02-16 18:12:13 +01:00
|
|
|
<div class="apps-card-right">
|
|
|
|
<div class="apps-configured">
|
|
|
|
{{#if component.isSending}}
|
|
|
|
<span>Sending Invite...</span>
|
|
|
|
{{else}}
|
2017-02-27 07:31:01 +01:00
|
|
|
<a class="apps-configured-action red-hover" href="#revoke" {{action "revoke" target=component}} data-test-revoke-button>
|
2017-02-16 18:12:13 +01:00
|
|
|
Revoke
|
|
|
|
</a>
|
2017-02-27 07:31:01 +01:00
|
|
|
<a class="apps-configured-action green-hover" href="#resend" {{action "resend" target=component}} data-test-resend-button>
|
2017-02-16 18:12:13 +01:00
|
|
|
Resend
|
|
|
|
</a>
|
2016-11-16 12:01:58 +01:00
|
|
|
|
2017-02-27 07:31:01 +01:00
|
|
|
<span class="apps-configured-action gh-badge {{invite.role.lowerCaseName}}" data-test-role-name>{{invite.role.name}}</span>
|
2017-02-16 18:12:13 +01:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
{{/gh-user-invited}}
|
|
|
|
{{/each}}
|
2014-07-06 17:56:29 +02:00
|
|
|
|
2017-02-16 18:12:13 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
{{/unless}}
|
|
|
|
|
2019-06-18 12:47:21 +02:00
|
|
|
<section class="apps-grid-container gh-active-users {{unless invites "apps-first-header"}}" data-test-active-users>
|
2017-02-16 18:12:13 +01:00
|
|
|
<span class="apps-grid-title">Active users</span>
|
|
|
|
<div class="apps-grid">
|
2019-01-14 15:50:30 +01:00
|
|
|
{{!-- For authors/contributors, only show their own user --}}
|
|
|
|
{{#if currentUser.isAuthorOrContributor}}
|
|
|
|
{{#gh-user-active user=currentUser as |component|}}
|
|
|
|
{{gh-user-list-item user=currentUser component=component}}
|
|
|
|
{{/gh-user-active}}
|
2017-05-16 13:32:13 +02:00
|
|
|
{{else}}
|
2019-01-14 15:50:30 +01:00
|
|
|
{{#vertical-collection sortedActiveUsers
|
|
|
|
key="id"
|
|
|
|
containerSelector=".gh-main"
|
|
|
|
estimateHeight=75
|
|
|
|
as |user|
|
|
|
|
}}
|
2015-06-30 15:21:03 +02:00
|
|
|
{{#gh-user-active user=user as |component|}}
|
2017-09-12 14:41:49 +02:00
|
|
|
{{gh-user-list-item user=user component=component}}
|
2015-06-30 15:21:03 +02:00
|
|
|
{{/gh-user-active}}
|
2019-01-14 15:50:30 +01:00
|
|
|
{{/vertical-collection}}
|
2017-05-16 13:32:13 +02:00
|
|
|
{{/if}}
|
2017-02-16 18:12:13 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
2017-07-31 15:10:52 +02:00
|
|
|
</section>
|
2017-03-08 19:21:35 +01:00
|
|
|
|
2017-05-16 13:32:13 +02:00
|
|
|
{{!-- Don't show if we have no suspended users or logged in as an author --}}
|
2019-01-14 15:50:30 +01:00
|
|
|
{{#if (and suspendedUsers (not currentUser.isAuthorOrContributor))}}
|
2017-03-08 19:21:35 +01:00
|
|
|
<section class="apps-grid-container gh-active-users" data-test-suspended-users>
|
|
|
|
<span class="apps-grid-title">Suspended users</span>
|
|
|
|
<div class="apps-grid">
|
|
|
|
{{#each sortedSuspendedUsers key="id" as |user|}}
|
2017-05-16 13:32:13 +02:00
|
|
|
{{#gh-user-active user=user as |component|}}
|
2018-04-02 20:19:40 +02:00
|
|
|
{{gh-user-list-item user=user component=component}}
|
2017-05-16 13:32:13 +02:00
|
|
|
{{/gh-user-active}}
|
2017-03-08 19:21:35 +01:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
2015-06-13 16:34:09 +02:00
|
|
|
</section>
|