2017-02-16 20:12:13 +03:00
|
|
|
<section class="gh-canvas">
|
|
|
|
<header class="gh-canvas-header">
|
2017-02-17 08:50:07 +03:00
|
|
|
<h2 class="gh-canvas-title">Team members</h2>
|
2015-06-30 16:21:03 +03:00
|
|
|
{{!-- Do not show Invite user button to authors --}}
|
|
|
|
{{#unless session.user.isAuthor}}
|
|
|
|
<section class="view-actions">
|
2017-02-16 22:50:05 +03:00
|
|
|
<button class="gh-btn gh-btn-green" {{action "toggleInviteUserModal"}} ><span>Invite People</span></button>
|
2015-06-30 16:21:03 +03:00
|
|
|
</section>
|
|
|
|
{{/unless}}
|
2014-10-16 19:28:51 +04:00
|
|
|
</header>
|
|
|
|
|
2017-01-31 12:10:36 +03:00
|
|
|
{{#if showInviteUserModal}}
|
|
|
|
{{gh-fullscreen-modal "invite-new-user"
|
|
|
|
close=(action "toggleInviteUserModal")
|
2017-02-16 20:12:13 +03:00
|
|
|
modifier="action wide"}}
|
2017-01-31 12:10:36 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2015-06-13 17:34:09 +03:00
|
|
|
{{#gh-infinite-scroll
|
|
|
|
fetch="loadNextPage"
|
|
|
|
isLoading=isLoading
|
|
|
|
tagName="section"
|
2017-02-16 20:12:13 +03:00
|
|
|
classNames="gh-team"
|
2015-06-13 17:34:09 +03:00
|
|
|
}}
|
2017-02-16 20:12:13 +03:00
|
|
|
|
|
|
|
{{!-- Show invited users to everyone except authors --}}
|
|
|
|
{{#unless session.user.isAuthor}}
|
|
|
|
{{#if invites}}
|
|
|
|
<section class="apps-grid-container gh-invited-users">
|
|
|
|
<span class="apps-grid-title">Invited users</span>
|
|
|
|
<div class="apps-grid">
|
|
|
|
|
|
|
|
{{#each sortedInvites as |invite|}}
|
|
|
|
{{#gh-user-invited invite=invite reload="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 icon-mail">ic</span>
|
|
|
|
<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>
|
|
|
|
{{/gh-user-invited}}
|
|
|
|
{{/each}}
|
2014-07-06 19:56:29 +04:00
|
|
|
|
2017-02-16 20:12:13 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
{{/unless}}
|
|
|
|
|
|
|
|
<section class="apps-grid-container gh-active-users">
|
|
|
|
<span class="apps-grid-title">Active users</span>
|
|
|
|
<div class="apps-grid">
|
2016-09-26 19:03:53 +03:00
|
|
|
{{#each users key="id" as |user|}}
|
2015-06-30 16:21:03 +03:00
|
|
|
{{!-- For authors only shows users as a list, otherwise show users with links to user page --}}
|
|
|
|
{{#unless session.user.isAuthor}}
|
|
|
|
{{#gh-user-active user=user as |component|}}
|
2017-02-16 20:12:13 +03:00
|
|
|
{{partial 'user-list-item'}}
|
2015-06-30 16:21:03 +03:00
|
|
|
{{/gh-user-active}}
|
|
|
|
{{else}}
|
|
|
|
{{#gh-user-active user=user as |component|}}
|
|
|
|
<li class="ember-view active user-list-item">{{partial 'user-list-item'}}</li>
|
|
|
|
{{/gh-user-active}}
|
|
|
|
{{/unless}}
|
2015-06-13 17:34:09 +03:00
|
|
|
{{/each}}
|
2017-02-16 20:12:13 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2015-06-13 17:34:09 +03:00
|
|
|
{{/gh-infinite-scroll}}
|
|
|
|
</section>
|