2017-02-16 20:12:13 +03:00
|
|
|
<section class="gh-canvas">
|
2019-06-18 13:47:21 +03:00
|
|
|
<GhCanvasHeader class="gh-canvas-header">
|
2019-02-22 12:43:35 +03:00
|
|
|
<h2 class="gh-canvas-title" data-test-screen-title>Staff users</h2>
|
2015-06-30 16:21:03 +03:00
|
|
|
{{!-- Do not show Invite user button to authors --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#unless this.currentUser.isAuthorOrContributor}}
|
2015-06-30 16:21:03 +03:00
|
|
|
<section class="view-actions">
|
2021-07-02 00:09:03 +03:00
|
|
|
{{#if (gh-user-can-admin this.session.user)}}
|
2021-06-07 12:05:46 +03:00
|
|
|
<span class="dropdown">
|
|
|
|
<GhDropdownButton
|
|
|
|
@dropdownName="staff-actions-menu"
|
2021-07-23 17:05:22 +03:00
|
|
|
@classNames="gh-btn gh-btn-icon icon-only gh-btn-action-icon"
|
2021-06-07 12:05:46 +03:00
|
|
|
@title="Staff Actions"
|
|
|
|
data-test-button="staff-actions"
|
|
|
|
>
|
|
|
|
<span>
|
|
|
|
{{svg-jar "settings"}}
|
|
|
|
<span class="hidden">Actions</span>
|
|
|
|
</span>
|
|
|
|
</GhDropdownButton>
|
|
|
|
<GhDropdown
|
|
|
|
@name="staff-actions-menu"
|
|
|
|
@tagName="ul"
|
|
|
|
@classNames="gh-member-actions-menu dropdown-menu dropdown-triangle-top-right"
|
|
|
|
>
|
|
|
|
<li >
|
|
|
|
<button {{on "click" (action "toggleResetAllPasswordsModal")}}>
|
|
|
|
<span>Reset all passwords</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</GhDropdown>
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
2021-04-07 17:20:30 +03:00
|
|
|
<button class="gh-btn gh-btn-primary" {{on "click" (action "toggleInviteUserModal")}} data-test-button="invite-staff-user"><span>Invite people</span></button>
|
2015-06-30 16:21:03 +03:00
|
|
|
</section>
|
|
|
|
{{/unless}}
|
2019-06-18 13:47:21 +03:00
|
|
|
</GhCanvasHeader>
|
2014-10-16 19:28:51 +04:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showInviteUserModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="invite-new-user"
|
|
|
|
@close={{action "toggleInviteUserModal"}}
|
2021-04-27 13:24:45 +03:00
|
|
|
@modifier="action wide invite-user" />
|
2017-01-31 12:10:36 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2021-06-07 12:05:46 +03:00
|
|
|
{{#if this.showResetAllPasswordsModal}}
|
|
|
|
<GhFullscreenModal @modal="reset-all-passwords"
|
|
|
|
@close={{action "toggleResetAllPasswordsModal"}}
|
|
|
|
@modifier="action wide" />
|
|
|
|
{{/if}}
|
|
|
|
|
2021-02-08 23:16:41 +03:00
|
|
|
<section class="view-container gh-team">
|
2017-02-16 20:12:13 +03:00
|
|
|
{{!-- Show invited users to everyone except authors --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#unless this.currentUser.isAuthorOrContributor}}
|
|
|
|
{{#if this.invites}}
|
2021-02-08 23:37:05 +03:00
|
|
|
<section class="gh-main-section gh-invited-users apps-first-header" data-test-invited-users>
|
2021-02-09 00:30:48 +03:00
|
|
|
<h4 class="gh-main-section-header small">Invited users</h4>
|
2017-02-16 20:12:13 +03:00
|
|
|
<div class="apps-grid">
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.sortedInvites as |invite|}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhUserInvited @invite={{invite}} @reload={{route-action "reload"}} as |component|>
|
2017-02-17 12:59:57 +03:00
|
|
|
<div class="apps-grid-cell" data-test-invite-id="{{invite.id}}">
|
2017-02-16 20:12:13 +03:00
|
|
|
<article class="apps-card-app">
|
|
|
|
<div class="apps-card-left">
|
2018-03-19 12:57:31 +03:00
|
|
|
<span class="user-list-item-icon">{{svg-jar "email"}}ic</span>
|
2017-02-16 20:12:13 +03:00
|
|
|
<div class="apps-card-meta">
|
2017-02-17 12:59:57 +03:00
|
|
|
<h3 class="apps-card-app-title" data-test-email>{{invite.email}}</h3>
|
2017-02-16 20:12:13 +03: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 16:11:39 +03:00
|
|
|
<span class="description" data-test-invite-description>
|
2017-02-16 20:12:13 +03:00
|
|
|
Invitation sent: {{component.createdAt}},
|
2017-02-27 16:11:39 +03:00
|
|
|
{{if component.isExpired "expired" "expires"}} {{component.expiresAt}}
|
2017-02-16 20:12:13 +03:00
|
|
|
</span>
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
</div>
|
2015-06-30 16:21:03 +03:00
|
|
|
</div>
|
2017-02-16 20:12:13 +03:00
|
|
|
<div class="apps-card-right">
|
|
|
|
<div class="apps-configured">
|
|
|
|
{{#if component.isSending}}
|
|
|
|
<span>Sending Invite...</span>
|
|
|
|
{{else}}
|
2017-02-27 09:31:01 +03:00
|
|
|
<a class="apps-configured-action red-hover" href="#revoke" {{action "revoke" target=component}} data-test-revoke-button>
|
2017-02-16 20:12:13 +03:00
|
|
|
Revoke
|
|
|
|
</a>
|
2017-02-27 09:31:01 +03:00
|
|
|
<a class="apps-configured-action green-hover" href="#resend" {{action "resend" target=component}} data-test-resend-button>
|
2017-02-16 20:12:13 +03:00
|
|
|
Resend
|
|
|
|
</a>
|
2016-11-16 14:01:58 +03:00
|
|
|
|
2017-02-27 09:31:01 +03:00
|
|
|
<span class="apps-configured-action gh-badge {{invite.role.lowerCaseName}}" data-test-role-name>{{invite.role.name}}</span>
|
2017-02-16 20:12:13 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</div>
|
2020-01-16 18:14:03 +03:00
|
|
|
</GhUserInvited>
|
2017-02-16 20:12:13 +03:00
|
|
|
{{/each}}
|
2014-07-06 19:56:29 +04:00
|
|
|
|
2017-02-16 20:12:13 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
{{/unless}}
|
|
|
|
|
2021-02-08 23:37:05 +03:00
|
|
|
<section class="gh-main-section gh-active-users {{unless this.invites "apps-first-header"}}" data-test-active-users>
|
2021-02-09 00:30:48 +03:00
|
|
|
<h4 class="gh-main-section-header small">Active users</h4>
|
2017-02-16 20:12:13 +03:00
|
|
|
<div class="apps-grid">
|
2019-01-14 17:50:30 +03:00
|
|
|
{{!-- For authors/contributors, only show their own user --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.currentUser.isAuthorOrContributor}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhUserActive @user={{this.currentUser}} as |component|>
|
|
|
|
<GhUserListItem @user={{this.currentUser}} @component={{component}} />
|
|
|
|
</GhUserActive>
|
2017-05-16 14:32:13 +03:00
|
|
|
{{else}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#vertical-collection this.sortedActiveUsers
|
2019-01-14 17:50:30 +03:00
|
|
|
key="id"
|
|
|
|
containerSelector=".gh-main"
|
|
|
|
estimateHeight=75
|
|
|
|
as |user|
|
|
|
|
}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhUserActive @user={{user}} as |component|>
|
|
|
|
<GhUserListItem @user={{user}} @component={{component}} />
|
|
|
|
</GhUserActive>
|
2019-01-14 17:50:30 +03:00
|
|
|
{{/vertical-collection}}
|
2017-05-16 14:32:13 +03:00
|
|
|
{{/if}}
|
2017-02-16 20:12:13 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
2017-07-31 16:10:52 +03:00
|
|
|
</section>
|
2017-03-08 21:21:35 +03:00
|
|
|
|
2017-05-16 14:32:13 +03:00
|
|
|
{{!-- Don't show if we have no suspended users or logged in as an author --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if (and this.suspendedUsers (not this.currentUser.isAuthorOrContributor))}}
|
2017-03-08 21:21:35 +03: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">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.sortedSuspendedUsers key="id" as |user|}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhUserActive @user={{user}} as |component|>
|
|
|
|
<GhUserListItem @user={{user}} @component={{component}} />
|
|
|
|
</GhUserActive>
|
2017-03-08 21:21:35 +03:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
2015-06-13 17:34:09 +03:00
|
|
|
</section>
|