2023-09-11 19:44:52 +08:00
|
|
|
<section class="award-badge">
|
2024-09-05 10:18:23 +08:00
|
|
|
<h2>{{i18n "admin.badges.mass_award.title"}}</h2>
|
2020-01-14 01:44:22 +08:00
|
|
|
<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">
|
2023-10-31 15:57:50 +08:00
|
|
|
<label class="checkbox-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
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{this.massAward}}
|
2022-07-06 01:41:31 +08:00
|
|
|
@disabled={{this.massAwardButtonDisabled}}
|
|
|
|
@icon="certificate"
|
|
|
|
@label="admin.badges.mass_award.perform"
|
2023-08-31 17:49:35 +08:00
|
|
|
type="submit"
|
|
|
|
class="btn-primary"
|
2022-07-06 01:41:31 +08:00
|
|
|
/>
|
2022-06-30 18:30:50 +08:00
|
|
|
<LinkTo @route="adminBadges.index" class="btn btn-normal">
|
2024-09-13 23:50:52 +08:00
|
|
|
{{d-icon "xmark"}}
|
2020-01-14 02:53:41 +08:00
|
|
|
<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}}
|
2024-09-13 23:50:52 +08:00
|
|
|
{{d-icon "xmark" class="bulk-award-status-icon failure"}}
|
2021-07-15 10:53:26 +08:00
|
|
|
{{/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
|
2024-09-13 23:50:52 +08:00
|
|
|
"triangle-exclamation"
|
2021-07-15 10:53:26 +08:00
|
|
|
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}}
|
2023-09-11 19:44:52 +08:00
|
|
|
</section>
|