2019-10-04 12:33:10 +03:00
<header class="modal-header" data-test-modal="import-members">
<h1>
2020-07-09 08:31:28 +03:00
{{ # if this .summary }}
2020-07-07 18:53:59 +03:00
Import complete {{ unless this .importResponse .invalid .count "!" }}
2019-10-04 12:33:10 +03:00
{{ else }}
2020-07-09 13:11:30 +03:00
{{ # if this .uploading }}
Importing members
{{ else }}
Import members
{{ / if }}
2019-10-04 12:33:10 +03:00
{{ / if }}
</h1>
</header>
2020-05-28 19:11:21 +03:00
<a class="close" href="" role="button" title="Close" {{ action "closeModal" }} > {{ svg-jar "close" }} <span class="hidden">Close</span></a>
2019-10-04 12:33:10 +03:00
2020-07-09 08:31:28 +03:00
<div class="modal-body">
{{ # if ( and this .filePresent ( not this .failureMessage ) ) }}
{{ # if this .validating }}
{{ # if validationErrors }}
<div class="failed flex items-start gh-members-upload-errorcontainer {{ if this .importDisabled "error" "warning" }} ">
<div class="mr3">
{{ # if this .importDisabled }}
{{ svg-jar "warning" class = "nudge-top--2 w5 h5 fill-red" }}
{{ else }}
{{ svg-jar "warning" class = "nudge-top--2 w5 h5 fill-yellow-d1" }}
{{ / if }}
</div>
<div class="ma0">
<p class="ma0 pa0 flex-grow w-100">The CSV contains errors! {{ unless this .importDisabled "Some members will not be imported." }} </p>
{{ # if validationErrors }}
<ul class="ma0 pa0 mt4 list bt b--whitegrey">
{{ # each validationErrors as | error | }}
<li class="gh-members-import-errormessage">
<span> {{{ error .message }}} </span>
{{ # if error .context }}
<p class="gh-members-import-errorcontext"> {{{ error .context }}} </p>
{{ / if }}
</li>
{{ / each }}
</ul>
{{ / if }}
</div>
</div>
{{ else }}
<div class="bg-whitegrey-l2 ba b--whitegrey br3 gh-image-uploader gh-members-import-spinner">
<div class="gh-loading-content">
<div class="gh-loading-spinner"></div>
</div>
</div>
{{ / if }}
{{ / if }}
{{ # if this .customizing }}
<GhFormGroup>
{{ # if this .config .enableDeveloperExperiments }}
<div class="gh-members-import-scrollarea">
<GhMembersImportTable
@importData= {{ this .fileData }}
@mapping= {{ this .mapping }}
@updateMapping= {{ action "updateMapping" }} />
</div>
{{ else }}
<div class="bg-whitegrey-l2 ba b--whitegrey br3">
<div class="flex flex-column items-center justify-center gh-members-import-file">
{{ svg-jar "file-tabular-data" class = "w9 h9 mb1 stroke-midgrey" }}
<div class="description midgrey"> {{ this .file .name }} </div>
</div>
</div>
{{ / if }}
2020-07-07 18:53:59 +03:00
2020-07-09 08:31:28 +03:00
<div class="mt4">
2020-07-09 15:42:29 +03:00
<label for="label-input"><span class="fw6 f8 dib mb1">Label these members</span></label>
2020-07-09 08:31:28 +03:00
<GhMemberLabelInput @member= {{ this .labels }} @triggerId="label-input" />
2020-07-07 18:53:59 +03:00
</div>
2020-07-09 08:31:28 +03:00
</GhFormGroup>
{{ / if }}
{{ # if this .uploading }}
2020-07-09 18:30:24 +03:00
<div class="progress-container pt20 pb20">
2020-07-09 08:31:28 +03:00
<div class="gh-progress-container-progress">
<div class="gh-progress-bar {{ if this .failureMessage "-error" }} " style= {{ this .progressStyle }} ></div>
2020-07-07 18:53:59 +03:00
</div>
</div>
2020-07-09 08:31:28 +03:00
{{ / if }}
2020-07-07 18:53:59 +03:00
2020-07-09 08:31:28 +03:00
{{ # if this .summary }}
<div class="ba b--whitegrey br3 middarkgrey bg-whitegrey-l2">
2020-07-07 18:53:59 +03:00
<div class="flex items-start">
2020-07-09 08:31:28 +03:00
<div class="w-50 gh-member-import-result-summary">
<h2> {{ format-number this .importResponse .imported .count }} </h2>
<p> {{ pluralize this .importResponse .imported .count "Member" with out-count = true }} added</p>
</div>
<div class="bl b--whitegrey w-50 gh-member-import-result-summary">
<h2> {{ format-number this .importResponse .invalid .count }} </h2>
<p> {{ pluralize this .importResponse .invalid .count "Error" with out-count = true }} </p>
2020-07-07 18:53:59 +03:00
</div>
2020-06-18 16:22:46 +03:00
</div>
</div>
2020-07-09 08:31:28 +03:00
{{ # if this .importResponse .invalid .count }}
<div class="mt6 gh-members-upload-errorcontainer error">
<div class="flex items-start">
{{ svg-jar "warning" class = "w5 h5 fill-red nudge-top--3 mr3" }}
<div class="flex-grow w-100">
<p class="ma0 pa0"> {{ format-number this .importResponse .invalid .count }} {{ pluralize this .importResponse .invalid .count "member" with out-count = true }} were skipped due to the following errors:</p>
{{ # if this .config .enableDeveloperExperiments }}
2020-07-07 18:53:59 +03:00
<ul class="ma0 pa0 mt4 list bt b--whitegrey">
2020-07-09 08:31:28 +03:00
{{ # each this .importResponse .invalid .errors as | error | }}
2020-07-09 13:11:30 +03:00
<li class="gh-members-import-errormessage"> {{ error .message }} <span class="fw4">( {{ format-number error .count }} )</span></li>
2020-07-07 18:53:59 +03:00
{{ / each }}
</ul>
{{ / if }}
</div>
2020-06-19 20:42:09 +03:00
</div>
2020-06-05 15:20:23 +03:00
</div>
{{ / if }}
2020-07-09 08:31:28 +03:00
{{ / if }}
{{ else }}
{{ # if this .failureMessage }}
<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>
<p class="ma0 pa0"> {{ this .failureMessage }} </p>
2020-06-05 13:57:07 +03:00
</div>
{{ / if }}
2020-07-09 08:31:28 +03:00
<div class="upload-form bg-whitegrey-l2 ba b--whitegrey br3">
<section class="gh-image-uploader gh-members-import-uploader {{ this .dragClass }} ">
<GhFileInput @multiple= {{ false }} @alt= {{ this .labelText }} @action= {{ action "fileSelected" }} @accept= {{ this .accept }} >
<div class="flex flex-column items-center">
{{ svg-jar "upload" class = "w9 h9 mb1 stroke-midgrey" }}
<div class="description midgrey"> {{ this .labelText }} </div>
</div>
</GhFileInput>
</section>
</div>
{{ / if }}
</div>
2019-10-04 12:33:10 +03:00
2020-07-09 18:30:24 +03:00
<div class="modal-footer {{ unless this .importResponse "modal-footer-spread" }} ">
2020-06-12 11:01:46 +03:00
{{ # if this .importResponse }}
2020-06-05 16:03:43 +03:00
<button {{ action "closeModal" }} disabled= {{ this .closeDisabled }} class="gh-btn gh-btn-blue" data-test-button="close-import-members">
2020-07-07 18:53:59 +03:00
<span> {{ if this .importResponse .invalid .count "Done" "Awesome" }} </span>
2020-06-05 16:03:43 +03:00
</button>
{{ else if ( and this .filePresent ( not this .failureMessage ) ) }}
2020-07-06 15:28:30 +03:00
{{ # if this .validating }}
2020-07-07 18:53:59 +03:00
{{ # if validationErrors }}
<button {{ action "reset" }} class="gh-btn" data-test-button="close-import-members">
<span>Start over</span>
</button>
2020-07-08 14:09:23 +03:00
{{ # unless this .importDisabled }}
<button class="gh-btn gh-btn-blue" {{ action "continueImport" }} >
<span>Continue</span>
</button>
{{ / unless }}
2020-07-07 18:53:59 +03:00
{{ / if }}
2020-07-09 08:31:28 +03:00
{{ / if }}
{{ # if this .customizing }}
2020-07-07 18:53:59 +03:00
<button {{ action "reset" }} class="gh-btn" data-test-button="close-import-members">
<span>Start over</span>
</button>
2020-07-06 15:28:30 +03:00
<button class="gh-btn gh-btn-green" {{ action "upload" }} disabled= {{ this .importDisabled }} >
2020-07-08 16:51:12 +03:00
<span>Import {{ # if this .fileData .length }} {{ format-number this .fileData .length }} {{ pluralize this .fileData .length 'member' with out-count = true }} {{ / if }} </span>
2020-07-06 15:28:30 +03:00
</button>
{{ / if }}
2020-06-05 13:57:07 +03:00
{{ else }}
<button {{ action "closeModal" }} disabled= {{ this .closeDisabled }} class="gh-btn" data-test-button="close-import-members">
2020-06-05 15:20:23 +03:00
<span>Close</span>
2020-06-05 13:57:07 +03:00
</button>
2020-07-09 18:30:24 +03:00
<a class="gh-btn" href="https://static.ghost.org/v3.0.0/files/member-import-template.csv" target="_blank">
<span>Download sample CSV file</span>
</a>
2020-06-05 13:57:07 +03:00
{{ / if }}
2019-10-04 12:33:10 +03:00
</div>