mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
This commit is contained in:
22
app/assets/javascripts/admin/templates/badges-award.hbs
Normal file
22
app/assets/javascripts/admin/templates/badges-award.hbs
Normal file
@@ -0,0 +1,22 @@
|
||||
{{#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}}
|
||||
Reference in New Issue
Block a user