2020-12-09 22:32:31 +03:00
<div class="gh-member-import-wrapper {{ if ( or ( eq this .state 'MAPPING' ) ( eq this .state 'UPLOADING' ) ) "wide" }} ">
{{ # if ( eq this .state 'INIT' ) }}
<header class="modal-header" data-test-modal="import-members">
<h1>Import members</h1>
</header>
2022-02-08 16:56:19 +03:00
<p class="gh-box gh-box-green">Need some help? <a href="https://ghost.org/help/import-members/" target="_blank" rel="noopener noreferrer">Learn more</a> about importing members or <a href="https://static.ghost.org/v4.0.0/files/member-import-template.csv" target="_blank" rel="noopener noreferrer">download a sample CSV file</a>.</p>
2020-12-09 22:32:31 +03:00
{{ / if }}
{{ # if ( or ( eq this .state 'MAPPING' ) ( eq this .state 'UPLOADING' ) ) }}
<header class="modal-header" data-test-modal="import-members">
<h1>Import members</h1>
</header>
{{ / if }}
{{ # if ( eq this .state 'PROCESSING' ) }}
<header class="modal-header icon-center" data-test-modal="import-members">
<GhLoadingSpinner />
<h1>Import in progress</h1>
</header>
{{ / if }}
{{ # if ( eq this .state 'COMPLETE' ) }}
<header class="modal-header icon-center" data-test-modal="import-members">
{{ # if this .importResponse .errorCount }}
2020-12-10 14:03:56 +03:00
{{ # if ( eq this .importResponse .importedCount 0 ) }}
{{ svg-jar "members-outline" class = "gh-member-import-icon-members midgrey" }}
{{ else }}
{{ svg-jar "members-outline" class = "gh-member-import-icon-members green" }}
{{ / if }}
2020-07-09 08:31:28 +03:00
{{ else }}
2020-12-09 22:32:31 +03:00
{{ svg-jar "confetti" class = "gh-member-import-icon-confetti" }}
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-12-09 22:32:31 +03:00
<h1>Import complete</h1>
</header>
{{ / if }}
2020-07-09 08:31:28 +03:00
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'ERROR' ) }}
<header class="modal-header" data-test-modal="import-members">
2021-07-27 15:19:26 +03:00
<h1> {{ this .errorHeader }} </h1>
2020-12-09 22:32:31 +03:00
</header>
{{ / if }}
2020-07-13 08:25:56 +03:00
2020-12-09 22:32:31 +03:00
<a class="close" href="" role="button" title="Close" {{ action "closeModal" }} >
{{ svg-jar "close" }}
<span class="hidden">Close</span>
</a>
2020-07-07 18:53:59 +03:00
2020-12-09 22:32:31 +03:00
<div class="modal-body">
{{ # if ( eq this .state 'INIT' ) }}
<ModalImportMembers::CsvFileSelect @setFile= {{ action "setFile" }} />
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ # if ( or ( eq this .state 'MAPPING' ) ( eq this .state 'UPLOADING' ) ) }}
2020-12-10 14:03:56 +03:00
<ModalImportMembers::CsvFileMapping
@file= {{ this .file }}
@setMappingResult= {{ action "setMappingResult" }}
@setFileData= {{ action "setMappingFileData" }}
@showErrors= {{ this .showMappingErrors }}
@disabled= {{ if ( or ( eq this .state 'UPLOADING' ) ( eq this .mappingResult .membersCount 0 ) ) true false }}
/>
2020-12-09 22:32:31 +03:00
{{ / if }}
{{ # if ( eq this .state 'PROCESSING' ) }}
<div class="gh-member-import-resultcontainer">
<div class="gh-member-import-result-summary">
<p>Your import is being processed, and you’ ll receive a confirmation email as soon as it’ s complete. Usually this only takes a few minutes, but larger imports may take longer.</p>
2020-07-07 18:53:59 +03:00
</div>
2020-12-09 22:32:31 +03:00
</div>
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-07-07 18:53:59 +03:00
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'COMPLETE' ) }}
<div class="gh-member-import-resultcontainer">
2020-12-10 14:03:56 +03:00
{{ # if ( eq this .importResponse .importedCount 0 ) }}
<div class="gh-member-import-result-summary">
<p>No members were added {{ if this .importResponse .errorCount " due to the following errors:" "." }} </p>
</div>
{{ else }}
2020-12-09 22:32:31 +03:00
<div class="gh-member-import-result-summary">
<p>A total of <strong> {{ format-number this .importResponse .importedCount }} </strong> {{ gh-pluralize this .importResponse .importedCount 'person' with out-count = true }} were successfully added or updated in your list of members, and now have access to your site.</p>
</div>
2020-12-10 14:03:56 +03:00
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ # if this .importResponse .errorCount }}
2020-12-10 14:03:56 +03:00
{{ # unless ( eq this .importResponse .importedCount 0 ) }}
<hr>
<div class="gh-member-import-result-summary">
<p><strong> {{ format-number this .importResponse .errorCount }} </strong> {{ gh-pluralize this .importResponse .errorCount "member" with out-count = true }} {{ if ( eq this .importResponse .errorCount 1 ) "was" "were" }} skipped due to the following errors:</p>
</div>
{{ / unless }}
2020-12-09 22:32:31 +03:00
<div class="gh-member-import-errorlist">
2020-12-10 14:03:56 +03:00
<ul>
2020-12-09 22:32:31 +03:00
{{ # each this .importResponse .errorList as | error | }}
2020-12-10 14:03:56 +03:00
<li> {{ error .message }} ( {{ error .count }} ) </li>
2020-12-09 22:32:31 +03:00
{{ / each }}
2020-12-10 14:03:56 +03:00
</ul>
2020-07-07 18:53:59 +03:00
</div>
2020-12-09 22:32:31 +03:00
{{ / if }}
2020-06-18 16:22:46 +03:00
</div>
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'ERROR' ) }}
2020-07-09 08:31:28 +03:00
<div class="failed flex items-start gh-members-upload-errorcontainer error">
<div class="mr2"> {{ svg-jar "warning" class = "nudge-top--2 w4 h4 fill-red" }} </div>
2020-12-09 22:32:31 +03:00
<p class="ma0 pa0"> {{ this .errorMessage }} </p>
2020-06-05 13:57:07 +03:00
</div>
{{ / if }}
2020-12-09 22:32:31 +03:00
</div>
2022-02-08 16:56:19 +03:00
<div class="modal-footer">
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'INIT' ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-09 22:32:31 +03:00
<span>Close</span>
</button>
{{ / if }}
{{ # if ( eq this .state 'MAPPING' ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-09 22:32:31 +03:00
<span>Start over</span>
</button>
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-green {{ unless this .mappingResult .membersCount "disabled" }} " type="button" {{ action "upload" }} >
2020-12-09 22:32:31 +03:00
{{ # if this .mappingResult .membersCount }}
<span>Import {{ format-number this .mappingResult .membersCount }} {{ gh-pluralize this .mappingResult .membersCount 'member' with out-count = true }} </span>
{{ else }}
<span>Import members</span>
{{ / if }}
</button>
{{ / if }}
{{ # if ( eq this .state 'UPLOADING' ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn disabled" disabled="disabled" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-09 22:32:31 +03:00
<span>Start over</span>
</button>
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-green gh-btn-icon disabled" disabled="disabled" type="button" {{ action "upload" }} >
2020-12-09 22:32:31 +03:00
<span> {{ svg-jar "spinner" class = "gh-icon-spinner" }} {{ this .runningText }} Uploading</span>
</button>
{{ / if }}
{{ # if ( eq this .state 'COMPLETE' ) }}
2021-03-10 17:17:07 +03:00
{{ # if this .importResponse .errorCount }}
2020-12-10 14:03:56 +03:00
<a href=" {{ this .importResponse .errorCsvUrl }} " download=" {{ this .importResponse .errorCsvName }} " class="gh-btn" data-test-button="restart-import-members">
2020-12-09 22:32:31 +03:00
<span>Download error file</span>
</a>
2020-12-10 14:03:56 +03:00
{{ # if ( eq this .importResponse .importedCount 0 ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-10 14:03:56 +03:00
<span>Try again</span>
</button>
{{ else }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-10 14:03:56 +03:00
<span>View members</span>
</button>
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ else }}
2020-12-10 14:03:56 +03:00
{{ # if ( eq this .importResponse .importedCount 0 ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-10 14:03:56 +03:00
<span>Close</span>
</button>
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-10 14:03:56 +03:00
<span>Try again</span>
</button>
{{ else }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-10 14:03:56 +03:00
<span>Upload another file</span>
</button>
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-10 14:03:56 +03:00
<span>View members</span>
</button>
{{ / if }}
2020-07-07 18:53:59 +03:00
{{ / if }}
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'PROCESSING' ) }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2020-12-09 22:32:31 +03:00
<span>Upload another file</span>
2020-07-07 18:53:59 +03:00
</button>
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-09 22:32:31 +03:00
<span>Got it</span>
2020-07-06 15:28:30 +03:00
</button>
{{ / if }}
2020-12-09 22:32:31 +03:00
{{ # if ( eq this .state 'ERROR' ) }}
2022-02-02 20:09:02 +03:00
{{ # if this .showTryAgainButton }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn" data-test-button="restart-import-members" type="button" {{ action "reset" }} >
2021-08-19 20:19:23 +03:00
<span>Try again</span>
</button>
{{ / if }}
2022-02-02 19:09:43 +03:00
<button class="gh-btn gh-btn-black" data-test-button="close-import-members" type="button" {{ action "closeModal" }} >
2020-12-09 22:32:31 +03:00
<span>OK</span>
</button>
{{ / if }}
</div>
</div>