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