discourse/app/assets/javascripts/admin/templates/badges-award.hbs
Roman Rizzi d69c5eebcf
Feature: Mass award badge (#8694)
* UI: Mass grant a badge from the admin ui

* Send the uploaded CSV and badge ID to the backend

* Read the CSV and grant badge in batches

* UX: Communicate the result to the user

* Don't award if badge is disabled

* Create a 'send_notification' method to remove duplicated code, slightly shrink badge image. Replace router transition with href.

* Dynamically discover current route
2020-01-13 11:20:26 -03:00

22 lines
720 B
Handlebars

{{#d-section class="award-badge"}}
<form class="form-horizontal">
<h1>{{i18n 'admin.badges.mass_award.title'}}</h1>
<div class='badge-preview'>
{{#if model}}
{{icon-or-image model}}
<span class="badge-display-name">{{model.name}}</span>
{{else}}
<span class='badge-placeholder'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
{{/if}}
</div>
<div>
<h4>{{I18n 'admin.badges.mass_award.upload_csv'}}</h4>
<input type='file' id='massAwardCSVUpload' accept='.csv' />
</div>
{{d-button
class="btn-primary"
action=(action 'massAward')
disabled=saving
label="admin.badges.save"}}
</form>
{{/d-section}}