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>
|
2020-02-03 08:22:14 -05:00
|
|
|
<label>{{i18n "admin.badges.badge"}}</label>
|
|
|
|
{{combo-box
|
|
|
|
filterable=true
|
|
|
|
value=selectedBadgeId
|
|
|
|
content=grantableBadges
|
|
|
|
onChange=(action (mut selectedBadgeId))
|
|
|
|
}}
|
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")
|
2020-02-05 09:23:35 -05:00
|
|
|
type="submit"
|
2019-11-04 05:23:54 -05:00
|
|
|
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">
|
2020-02-10 02:14:26 -05:00
|
|
|
<tbody>
|
2014-03-19 10:27:21 -04:00
|
|
|
<tr>
|
2020-02-10 02:14:26 -05:00
|
|
|
<th>{{i18n "admin.badges.badge"}}</th>
|
|
|
|
<th>{{i18n "admin.badges.granted_by"}}</th>
|
|
|
|
<th class="reason">{{i18n "admin.badges.reason"}}</th>
|
|
|
|
<th>{{i18n "admin.badges.granted_at"}}</th>
|
|
|
|
<th></th>
|
2014-03-19 10:27:21 -04:00
|
|
|
</tr>
|
2020-02-10 02:14:26 -05:00
|
|
|
{{#each groupedBadges as |userBadge|}}
|
|
|
|
<tr>
|
|
|
|
<td>{{user-badge badge=userBadge.badge count=userBadge.count}}</td>
|
|
|
|
<td>
|
|
|
|
{{#link-to "adminUser" userBadge.badge.granted_by}}
|
|
|
|
{{avatar userBadge.granted_by imageSize="tiny"}}
|
|
|
|
{{userBadge.granted_by.username}}
|
|
|
|
{{/link-to}}
|
|
|
|
</td>
|
|
|
|
<td class="reason">
|
|
|
|
{{#if userBadge.postUrl}}
|
2020-03-09 10:28:31 -04:00
|
|
|
<a href={{userBadge.postUrl}}>{{userBadge.topic_title}}</a>
|
2020-02-10 02:14:26 -05:00
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
<td>{{age-with-tooltip userBadge.granted_at}}</td>
|
|
|
|
<td>
|
|
|
|
{{#if userBadge.grouped}}
|
|
|
|
{{d-button
|
|
|
|
action=(action "expandGroup" userBadge)
|
|
|
|
label="admin.badges.expand"}}
|
|
|
|
{{else}}
|
|
|
|
{{d-button
|
|
|
|
class="btn-danger"
|
|
|
|
action=(action "revokeBadge" userBadge)
|
|
|
|
label="admin.badges.revoke"}}
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
|
|
|
<tr>
|
|
|
|
<td colspan="5">
|
|
|
|
<p>{{i18n "admin.badges.no_user_badges" name=user.username}}</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
2014-03-19 10:27:21 -04:00
|
|
|
</table>
|
|
|
|
</div>
|
2015-04-28 17:05:06 -04:00
|
|
|
{{/conditional-loading-spinner}}
|