2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.file}}
|
2016-02-26 16:25:47 +03:00
|
|
|
{{!-- Upload in progress! --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.failureMessage}}
|
|
|
|
<div class="failed">{{this.failureMessage}}</div>
|
2016-02-26 16:25:47 +03:00
|
|
|
{{/if}}
|
|
|
|
<div class="progress-container">
|
|
|
|
<div class="progress">
|
2019-12-13 17:20:29 +03:00
|
|
|
<div class="bar {{if this.failureMessage "fail"}}" style={{this.progressStyle}}></div>
|
2016-02-26 16:25:47 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.failureMessage}}
|
2017-02-16 22:50:05 +03:00
|
|
|
<button class="gh-btn gh-btn-green" {{action "reset"}}><span>Try Again</span></button>
|
2016-02-26 16:25:47 +03:00
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
2017-03-03 11:59:01 +03:00
|
|
|
{{!-- file selection/drag-n-drop --}}
|
|
|
|
<div class="upload-form">
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFileInput @multiple={{false}} @alt={{this.description}} @action={{action "fileSelected"}} @accept={{this.accept}}>
|
2019-12-13 17:20:29 +03:00
|
|
|
<div class="gh-btn gh-btn-outline" data-test-file-input-description><span>{{this.description}}</span></div>
|
2020-01-16 18:14:03 +03:00
|
|
|
</GhFileInput>
|
2017-08-02 10:05:59 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if (and this.allowUnsplash this.settings.unsplash.isActive)}}
|
2017-08-02 10:05:59 +03:00
|
|
|
<div class="gh-image-uploader-unsplash" {{action (toggle "_showUnsplash" this)}}>
|
2018-03-19 12:57:31 +03:00
|
|
|
{{svg-jar "unsplash"}}
|
2017-08-02 10:05:59 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2017-03-03 11:59:01 +03:00
|
|
|
</div>
|
2016-02-26 16:25:47 +03:00
|
|
|
{{/if}}
|
2017-08-02 10:05:59 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this._showUnsplash}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhUnsplash
|
|
|
|
@select={{action "addUnsplashPhoto"}}
|
|
|
|
@close={{action (toggle "_showUnsplash" this)}}
|
|
|
|
/>
|
2017-08-02 10:05:59 +03:00
|
|
|
{{/if}}
|