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">
|
2022-06-30 06:30:50 -04:00
|
|
|
<li><LinkTo @route="adminUser" @model={{user}}>{{d-icon "caret-left"}} {{user.username}}</LinkTo></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>
|
|
|
|
|
2022-06-30 06:30:50 -04:00
|
|
|
<ConditionalLoadingSpinner @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">
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2020-02-03 08:22:14 -05:00
|
|
|
<label>{{i18n "admin.badges.badge"}}</label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<ComboBox @value={{selectedBadgeId}} @content={{grantableBadges}} @onChange={{action (mut selectedBadgeId)}} @options={{hash
|
2022-04-05 13:01:09 -04:00
|
|
|
filterable=true
|
2022-06-30 06:30:50 -04:00
|
|
|
}} />
|
2015-02-24 20:52:43 -05:00
|
|
|
</div>
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2015-02-24 20:52:43 -05:00
|
|
|
<label>{{i18n "admin.badges.reason"}}</label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="text" @value={{badgeReason}} /><br><small>{{i18n "admin.badges.reason_help"}}</small>
|
2018-10-26 11:06:31 -04:00
|
|
|
</div>
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-primary" @action={{action "grantBadge"}} @type="submit" @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>
|
2022-06-30 06:30:50 -04:00
|
|
|
<td><UserBadge @badge={{userBadge.badge}} @count={{userBadge.count}} /></td>
|
2020-02-10 02:14:26 -05:00
|
|
|
<td>
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminUser" @model={{userBadge.badge.granted_by}}>
|
2020-02-10 02:14:26 -05:00
|
|
|
{{avatar userBadge.granted_by imageSize="tiny"}}
|
|
|
|
{{userBadge.granted_by.username}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2020-02-10 02:14:26 -05:00
|
|
|
</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}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @action={{action "expandGroup" userBadge}} @label="admin.badges.expand" />
|
2020-02-10 02:14:26 -05:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-danger" @action={{action "revokeBadge" userBadge}} @label="admin.badges.revoke" />
|
2020-02-10 02:14:26 -05:00
|
|
|
{{/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>
|
2022-06-30 06:30:50 -04:00
|
|
|
</ConditionalLoadingSpinner>
|