2014-03-19 10:27:21 -04:00
|
|
|
<div class='admin-controls'>
|
|
|
|
<div class='span15'>
|
|
|
|
<ul class='nav nav-pills'>
|
|
|
|
<li>{{#link-to 'adminUser' user}}<i class="fa fa-caret-left"></i> {{user.username}}{{/link-to}}</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</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>
|
2014-03-19 10:27:21 -04:00
|
|
|
{{#if noBadges}}
|
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>
|
2016-05-09 15:15:39 -04:00
|
|
|
{{combo-box valueAttribute="id" value=selectedBadgeId content=grantableBadges nameProperty="name"}}
|
2015-02-24 20:52:43 -05:00
|
|
|
</div>
|
|
|
|
<label>
|
|
|
|
<label>{{i18n 'admin.badges.reason'}}</label>
|
|
|
|
{{input type="text" value=badgeReason}}<br><small>{{i18n 'admin.badges.reason_help'}}</small>
|
|
|
|
</label>
|
2016-05-09 15:15:39 -04:00
|
|
|
<button class='btn btn-primary' {{action "grantBadge" selectedBadgeId}}>{{i18n 'admin.badges.grant'}}</button>
|
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}}
|
|
|
|
<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 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}}
|