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">
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2020-02-03 21:22:14 +08:00
|
|
|
<label>{{i18n "admin.badges.badge"}}</label>
|
|
|
|
{{combo-box
|
|
|
|
filterable=true
|
|
|
|
value=selectedBadgeId
|
|
|
|
content=grantableBadges
|
2020-10-07 05:50:05 +08:00
|
|
|
onChange=(action (mut selectedBadgeId))
|
2020-02-03 21:22:14 +08:00
|
|
|
}}
|
2015-02-25 09:52:43 +08:00
|
|
|
</div>
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2015-02-25 09:52:43 +08:00
|
|
|
<label>{{i18n "admin.badges.reason"}}</label>
|
|
|
|
{{input type="text" value=badgeReason}}<br><small>{{i18n "admin.badges.reason_help"}}</small>
|
2018-10-26 23:06:31 +08:00
|
|
|
</div>
|
2019-11-04 18:23:54 +08:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(action "grantBadge")
|
2020-02-05 22:23:35 +08:00
|
|
|
type="submit"
|
2019-11-04 18:23:54 +08:00
|
|
|
label="admin.badges.grant"}}
|
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">
|
2020-02-10 15:14:26 +08:00
|
|
|
<tbody>
|
2014-03-19 22:27:21 +08:00
|
|
|
<tr>
|
2020-02-10 15:14:26 +08: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 22:27:21 +08:00
|
|
|
</tr>
|
2020-02-10 15:14:26 +08: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 22:28:31 +08:00
|
|
|
<a href={{userBadge.postUrl}}>{{userBadge.topic_title}}</a>
|
2020-02-10 15:14:26 +08: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 22:27:21 +08:00
|
|
|
</table>
|
|
|
|
</div>
|
2015-04-29 05:05:06 +08:00
|
|
|
{{/conditional-loading-spinner}}
|