Ghost/ghost/admin/app/components/gh-image-uploader.hbs
naz 07abb5443a Fixed EmberObject.create error on Admin start (#1841)
refs https://github.com/TryGhost/Ghost/pull/12632

- The `unsplash` setting has been migrated to a new format - plain boolean value. This is why it's no longer needed to do any serialization dances
2021-02-18 13:25:21 +13:00

35 lines
1.2 KiB
Handlebars

{{#if this.file}}
{{!-- Upload in progress! --}}
{{#if this.failureMessage}}
<div class="failed">{{this.failureMessage}}</div>
{{/if}}
<div class="progress-container">
<div class="progress">
<div class="bar {{if this.failureMessage "fail"}}" style={{this.progressStyle}}></div>
</div>
</div>
{{#if this.failureMessage}}
<button class="gh-btn gh-btn-green" {{action "reset"}}><span>Try Again</span></button>
{{/if}}
{{else}}
{{!-- file selection/drag-n-drop --}}
<div class="upload-form">
<GhFileInput @multiple={{false}} @alt={{this.description}} @action={{action "fileSelected"}} @accept={{this.accept}}>
<div class="gh-btn gh-btn-white" data-test-file-input-description><span>{{this.description}}</span></div>
</GhFileInput>
{{#if (and this.allowUnsplash this.settings.unsplash)}}
<div class="gh-image-uploader-unsplash" {{action (toggle "_showUnsplash" this)}}>
{{svg-jar "unsplash"}}
</div>
{{/if}}
</div>
{{/if}}
{{#if this._showUnsplash}}
<GhUnsplash
@select={{action "addUnsplashPhoto"}}
@close={{action (toggle "_showUnsplash" this)}}
/>
{{/if}}