2014-03-19 10:27:21 -04:00
|
|
|
<div class='admin-controls'>
|
2018-02-14 12:26:05 -05:00
|
|
|
<nav>
|
2014-03-19 10:27:21 -04:00
|
|
|
<ul class='nav nav-pills'>
|
2017-07-26 16:33:17 -04:00
|
|
|
<li>{{#link-to 'adminUser' user}}{{d-icon "caret-left"}} {{user.username}}{{/link-to}}</li>
|
2014-03-19 10:27:21 -04:00
|
|
|
</ul>
|
2018-02-14 12:26:05 -05:00
|
|
|
</nav>
|
2014-03-19 10:27:21 -04:00
|
|
|
</div>
|
|
|
|
|
2015-04-28 17:05:06 -04:00
|
|
|
{{#conditional-loading-spinner condition=loading}}
|
2014-03-19 10:27:21 -04:00
|
|
|
<div class='admin-container user-badges'>
|
2014-12-08 16:35:49 -05:00
|
|
|
<h2>{{i18n 'admin.badges.grant_badge'}}</h2>
|
2015-02-24 20:52:43 -05:00
|
|
|
<br>
|
2018-01-21 22:10:53 -05:00
|
|
|
{{#if noGrantableBadges}}
|
2014-12-08 16:35:49 -05:00
|
|
|
<p>{{i18n 'admin.badges.no_badges'}}</p>
|
2014-03-19 10:27:21 -04:00
|
|
|
{{else}}
|
2015-02-24 20:52:43 -05:00
|
|
|
<form class="form-horizontal">
|
|
|
|
<div>
|
|
|
|
<label>{{i18n 'admin.badges.badge'}}</label>
|
2019-01-21 07:08:26 -05:00
|
|
|
{{combo-box forceEscape=true filterable=true value=selectedBadgeId content=grantableBadges}}
|
2015-02-24 20:52:43 -05:00
|
|
|
</div>
|
2018-10-26 11:06:31 -04:00
|
|
|
<div>
|
2015-02-24 20:52:43 -05:00
|
|
|
<label>{{i18n 'admin.badges.reason'}}</label>
|
|
|
|
{{input type="text" value=badgeReason}}<br><small>{{i18n 'admin.badges.reason_help'}}</small>
|
2018-10-26 11:06:31 -04:00
|
|
|
</div>
|
2019-11-04 05:23:54 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(action "grantBadge")
|
|
|
|
label="admin.badges.grant"}}
|
2015-02-24 20:52:43 -05:00
|
|
|
</form>
|
2014-03-19 10:27:21 -04:00
|
|
|
{{/if}}
|
|
|
|
|
2015-02-24 20:52:43 -05:00
|
|
|
<table id='user-badges'>
|
2014-03-19 10:27:21 -04:00
|
|
|
<tr>
|
2014-12-08 16:35:49 -05:00
|
|
|
<th>{{i18n 'admin.badges.badge'}}</th>
|
|
|
|
<th>{{i18n 'admin.badges.granted_by'}}</th>
|
2015-02-24 20:52:43 -05:00
|
|
|
<th class='reason'>{{i18n 'admin.badges.reason'}}</th>
|
2014-12-08 16:35:49 -05:00
|
|
|
<th>{{i18n 'admin.badges.granted_at'}}</th>
|
2014-03-19 10:27:21 -04:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
|
2016-05-09 16:20:35 -04:00
|
|
|
{{#each groupedBadges as |userBadge|}}
|
2014-03-19 10:27:21 -04:00
|
|
|
<tr>
|
2015-02-24 20:52:43 -05:00
|
|
|
<td>{{user-badge badge=userBadge.badge count=userBadge.count}}</td>
|
2014-03-19 10:27:21 -04:00
|
|
|
<td>
|
2015-02-24 20:52:43 -05:00
|
|
|
{{#link-to 'adminUser' userBadge.badge.granted_by}}
|
|
|
|
{{avatar userBadge.granted_by imageSize="tiny"}}
|
|
|
|
{{userBadge.granted_by.username}}
|
2014-03-19 10:27:21 -04:00
|
|
|
{{/link-to}}
|
|
|
|
</td>
|
2015-02-24 20:52:43 -05:00
|
|
|
<td class='reason'>
|
|
|
|
{{#if userBadge.postUrl}}
|
|
|
|
<a href="{{unbound userBadge.postUrl}}">{{userBadge.topic_title}}</a>
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
<td>{{age-with-tooltip userBadge.granted_at}}</td>
|
2014-03-19 10:27:21 -04:00
|
|
|
<td>
|
2015-02-24 20:52:43 -05:00
|
|
|
{{#if userBadge.grouped}}
|
2019-11-04 05:23:54 -05:00
|
|
|
{{d-button
|
|
|
|
action=(action "expandGroup" userBadge)
|
|
|
|
label="admin.badges.expand"}}
|
2015-02-24 20:52:43 -05:00
|
|
|
{{else}}
|
2019-11-04 05:23:54 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-danger"
|
|
|
|
action=(action "revokeBadge" userBadge)
|
|
|
|
label="admin.badges.revoke"}}
|
2015-02-24 20:52:43 -05:00
|
|
|
{{/if}}
|
2014-03-19 10:27:21 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
|
|
|
<tr>
|
|
|
|
<td colspan="5">
|
2014-12-08 16:35:49 -05:00
|
|
|
<p>{{i18n 'admin.badges.no_user_badges' name=user.username}}</p>
|
2014-03-19 10:27:21 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</table>
|
|
|
|
</div>
|
2015-04-28 17:05:06 -04:00
|
|
|
{{/conditional-loading-spinner}}
|