discourse/app/assets/javascripts/discourse/templates/group-index.hbs
2018-05-18 15:18:10 -04:00

76 lines
2.2 KiB
Handlebars

<div class="group-members-actions">
{{text-field value=filterInput
placeholderKey=filterPlaceholder
class="group-username-filter no-blur"}}
<div class="group-members-manage">
{{#if canManageGroup}}
{{d-button icon="plus"
action="showAddMembersModal"
label="groups.add_members.title"
class="group-members-add"}}
{{#if currentUser.admin}}
{{d-button icon="plus"
action="showBulkAddModal"
label="admin.groups.bulk_add.title"
class="group-bulk-add"}}
{{/if}}
{{/if}}
</div>
</div>
{{#if hasMembers}}
{{#load-more selector=".group-members tr" action="loadMore"}}
<table class='group-members'>
<thead>
{{group-index-toggle order=order desc=desc field='username_lower' i18nKey='username'}}
<th class='group-owner'>{{i18n "groups.members.owner"}}</th>
{{group-index-toggle order=order desc=desc field='last_posted_at' i18nKey='last_post'}}
{{group-index-toggle order=order desc=desc field='last_seen_at' i18nKey='last_seen'}}
<th></th>
</thead>
<tbody>
{{#each model.members as |m|}}
<tr>
<td class='avatar'>
{{user-info user=m skipName=skipName}}
</td>
<td class='group-owner'>
{{#if m.owner}}
<strong class="group-owner-label">
{{d-icon "shield"}}
</strong>
{{/if}}
</td>
<td>
<span class="text">{{bound-date m.last_posted_at}}</span>
</td>
<td>
<span class="text">{{bound-date m.last_seen_at}}</span>
</td>
<td>
{{#if canManageGroup}}
{{group-member-dropdown
removeMember="removeMember"
makeOwner="makeOwner"
removeOwner="removeOwner"
member=m}}
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
{{/load-more}}
{{conditional-loading-spinner condition=loading}}
{{else}}
<br>
<div>{{i18n "groups.empty.members"}}</div>
{{/if}}