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:
Roman Rizzi
2020-01-13 11:20:26 -03:00
committed by GitHub
parent eb105ba79d
commit d69c5eebcf
15 changed files with 291 additions and 34 deletions

View 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}}