Ghost/ghost/admin/app/templates/team/index.hbs

116 lines
5.6 KiB
Handlebars
Raw Normal View History

2017-02-16 20:12:13 +03:00
<section class="gh-canvas">
<header class="gh-canvas-header">
<h2 class="gh-canvas-title" data-test-screen-title>Team members</h2>
{{!-- Do not show Invite user button to authors --}}
{{#unless session.user.isAuthorOrContributor}}
<section class="view-actions">
<button class="gh-btn gh-btn-green" {{action "toggleInviteUserModal"}} ><span>Invite People</span></button>
</section>
{{/unless}}
</header>
{{#if showInviteUserModal}}
{{gh-fullscreen-modal "invite-new-user"
close=(action "toggleInviteUserModal")
2017-02-16 20:12:13 +03:00
modifier="action wide"}}
{{/if}}
<section class="gh-team">
2017-02-16 20:12:13 +03:00
{{!-- Show invited users to everyone except authors --}}
{{#unless session.user.isAuthorOrContributor}}
2017-02-16 20:12:13 +03:00
{{#if invites}}
<section class="apps-grid-container gh-invited-users" data-test-invited-users>
2017-02-16 20:12:13 +03:00
<span class="apps-grid-title">Invited users</span>
<div class="apps-grid">
{{#each sortedInvites as |invite|}}
{{#gh-user-invited 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">
<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}}
<span class="description" data-test-invite-description>
2017-02-16 20:12:13 +03:00
Invitation sent: {{component.createdAt}},
{{if component.isExpired "expired" "expires"}} {{component.expiresAt}}
2017-02-16 20:12:13 +03:00
</span>
{{/if}}
</p>
</div>
</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}}
<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>
<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>
<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>
{{/gh-user-invited}}
{{/each}}
2017-02-16 20:12:13 +03:00
</div>
</section>
{{/if}}
{{/unless}}
<section class="apps-grid-container gh-active-users" data-test-active-users>
2017-02-16 20:12:13 +03:00
<span class="apps-grid-title">Active users</span>
<div class="apps-grid">
{{!-- For authors/contributors only show their own user --}}
{{#if session.user.isAuthorOrContributor}}
{{#with session.user as |user|}}
{{#gh-user-active user=user as |component|}}
{{gh-user-list-item user=user component=component}}
{{/gh-user-active}}
{{/with}}
{{else}}
{{#each sortedActiveUsers key="id" as |user|}}
{{#gh-user-active user=user as |component|}}
{{gh-user-list-item user=user component=component}}
{{/gh-user-active}}
{{/each}}
{{/if}}
2017-02-16 20:12:13 +03:00
</div>
</section>
{{gh-infinity-loader
infinityModel=activeUsers
scrollable=".gh-main"
triggerOffset=500}}
</section>
{{!-- Don't show if we have no suspended users or logged in as an author --}}
{{#if (and suspendedUsers (not session.user.isAuthorOrContributor))}}
<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|}}
{{#gh-user-active user=user as |component|}}
{{gh-user-list-item user=user component=component}}
{{/gh-user-active}}
{{/each}}
</div>
</section>
{{/if}}
</section>