Ghost/ghost/admin/app/components/modal-upload-image.hbs
Kevin Ansfield 0d30077325 Switched to new component for labs feature image redesign
refs https://github.com/TryGhost/Team/issues/771

- added `<GhEditorFeatureImage>` for more flexibility than offered by `<GhImageUploaderWithPreview>`
  - updated to more closely match intended designs
- removed alt/caption support from `<GhImageUploaderWithPreview>` as it's no longer used
- fixed upload/delete/upload not working due to file input references getting out of sync
2021-06-16 17:56:25 +01:00

33 lines
1.2 KiB
Handlebars

<div class="modal-body">
{{#if this.url}}
<div class="gh-image-uploader -with-image">
<div><img src={{this.url}}></div>
<a class="image-delete" title="Delete" {{action 'removeImage'}}>
{{svg-jar "trash"}}
<span class="hidden">Delete</span>
</a>
</div>
{{else}}
<GhImageUploader
@image={{this.newUrl}}
@saveButton={{false}}
@update={{action "fileUploaded"}}
@uploadStarted={{action "isUploading"}}
@uploadFinished={{action "isUploading"}}
@accept={{this.model.accept}}
@extensions={{this.model.extensions}}
@uploadUrl={{this.model.uploadUrl}}
@paramsHash={{this.model.paramsHas}}
/>
{{/if}}
</div>
<div class="modal-footer">
<button {{action "closeModal"}} class="gh-btn"><span>Cancel</span></button>
{{#if this._isUploading}}
<button class="gh-btn gh-btn-black right gh-btn-icon disabled"><span>Save</span></button>
{{else}}
<GhTaskButton @task={{this.uploadImage}} @class="gh-btn gh-btn-black right gh-btn-icon" data-test-modal-accept-button={{true}} />
{{/if}}
</div>