2022-06-30 18:30:50 +08:00
|
|
|
<DSection @class="award-badge">
|
2020-01-14 01:44:22 +08:00
|
|
|
<h1>{{i18n "admin.badges.mass_award.title"}}</h1>
|
|
|
|
<p>{{i18n "admin.badges.mass_award.description"}}</p>
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.model}}
|
2020-01-14 01:44:22 +08:00
|
|
|
<form class="form-horizontal">
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="badge-preview control-group">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.model}}
|
|
|
|
{{icon-or-image this.model}}
|
|
|
|
<span class="badge-display-name">{{this.model.name}}</span>
|
2020-01-14 01:44:22 +08:00
|
|
|
{{else}}
|
2020-03-11 16:23:10 +08:00
|
|
|
<span class="badge-placeholder">{{i18n
|
|
|
|
"admin.badges.mass_award.no_badge_selected"
|
|
|
|
}}</span>
|
2020-01-14 01:44:22 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2020-03-11 16:23:10 +08:00
|
|
|
<h4>{{i18n "admin.badges.mass_award.upload_csv"}}</h4>
|
2021-07-15 10:53:26 +08:00
|
|
|
<input
|
|
|
|
type="file"
|
|
|
|
id="massAwardCSVUpload"
|
|
|
|
accept=".csv"
|
|
|
|
onchange={{action "updateFileSelected"}}
|
|
|
|
/>
|
2020-01-14 01:44:22 +08:00
|
|
|
</div>
|
2021-09-20 21:52:03 +08:00
|
|
|
<div class="control-group">
|
2020-01-24 01:14:58 +08:00
|
|
|
<label>
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.replaceBadgeOwners}} />
|
2020-01-24 01:14:58 +08:00
|
|
|
{{i18n "admin.badges.mass_award.replace_owners"}}
|
|
|
|
</label>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.model.multiple_grant}}
|
2021-07-15 10:53:26 +08:00
|
|
|
<label class="grant-existing-holders">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input
|
|
|
|
@type="checkbox"
|
|
|
|
@checked={{this.grantExistingHolders}}
|
|
|
|
class="grant-existing-holders-checkbox"
|
|
|
|
/>
|
2021-07-15 10:53:26 +08:00
|
|
|
{{i18n "admin.badges.mass_award.grant_existing_holders"}}
|
|
|
|
</label>
|
|
|
|
{{/if}}
|
2020-01-24 01:14:58 +08:00
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<DButton
|
|
|
|
@class="btn-primary"
|
|
|
|
@action={{action "massAward"}}
|
|
|
|
@type="submit"
|
|
|
|
@disabled={{this.massAwardButtonDisabled}}
|
|
|
|
@icon="certificate"
|
|
|
|
@label="admin.badges.mass_award.perform"
|
|
|
|
/>
|
2022-06-30 18:30:50 +08:00
|
|
|
<LinkTo @route="adminBadges.index" class="btn btn-normal">
|
2020-01-14 02:53:41 +08:00
|
|
|
{{d-icon "times"}}
|
|
|
|
<span>{{i18n "cancel"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</LinkTo>
|
2020-01-14 01:44:22 +08:00
|
|
|
</form>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.saving}}
|
2021-07-15 10:53:26 +08:00
|
|
|
{{i18n "uploading"}}
|
|
|
|
{{/if}}
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.resultsMessage}}
|
2021-07-15 10:53:26 +08:00
|
|
|
<p>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.success}}
|
2021-07-15 10:53:26 +08:00
|
|
|
{{d-icon "check" class="bulk-award-status-icon success"}}
|
|
|
|
{{else}}
|
|
|
|
{{d-icon "times" class="bulk-award-status-icon failure"}}
|
|
|
|
{{/if}}
|
2022-07-06 01:41:31 +08:00
|
|
|
{{this.resultsMessage}}
|
2021-07-15 10:53:26 +08:00
|
|
|
</p>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.unmatchedEntries.length}}
|
2021-07-15 10:53:26 +08:00
|
|
|
<p>
|
|
|
|
{{d-icon
|
|
|
|
"exclamation-triangle"
|
|
|
|
class="bulk-award-status-icon failure"
|
|
|
|
}}
|
|
|
|
<span>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.unmatchedEntriesTruncated}}
|
|
|
|
{{i18n
|
|
|
|
"admin.badges.mass_award.csv_has_unmatched_users_truncated_list"
|
|
|
|
count=this.unmatchedEntriesCount
|
|
|
|
}}
|
2021-07-15 10:53:26 +08:00
|
|
|
{{else}}
|
|
|
|
{{i18n "admin.badges.mass_award.csv_has_unmatched_users"}}
|
|
|
|
{{/if}}
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<ul>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.unmatchedEntries as |entry|}}
|
2021-07-15 10:53:26 +08:00
|
|
|
<li>{{entry}}</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2020-01-14 01:44:22 +08:00
|
|
|
{{else}}
|
2020-03-11 16:23:10 +08:00
|
|
|
<span class="badge-required">{{i18n
|
|
|
|
"admin.badges.mass_award.no_badge_selected"
|
|
|
|
}}</span>
|
2020-01-14 01:44:22 +08:00
|
|
|
{{/if}}
|
2022-06-30 18:30:50 +08:00
|
|
|
</DSection>
|