mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
85cce39af7
refs https://github.com/TryGhost/Team/issues/1734 refs https://github.com/TryGhost/Team/issues/559 refs https://github.com/TryGhost/Ghost/issues/14101 - switches to newer modal patterns ready for later Ember upgrades - cleaned up the `upload-image` modal which had multiple areas of code that were no longer being used - disabled `no-duplicate-landmark-elements` template lint rule as it's buggy and mostly gives false positives
38 lines
1.5 KiB
Handlebars
38 lines
1.5 KiB
Handlebars
<div class="modal-content" data-test-modal="upload-image">
|
|
<div class="modal-body">
|
|
{{#if this.url}}
|
|
<div class="gh-image-uploader -with-image">
|
|
<div><img src={{this.url}} alt="" role="presentation"></div>
|
|
<button type="button" class="image-delete" title="Delete" {{on "click" this.removeImage}}>
|
|
{{svg-jar "trash"}}
|
|
<span class="hidden">Delete</span>
|
|
</button>
|
|
</div>
|
|
{{else}}
|
|
<GhImageUploader
|
|
@image={{this.url}}
|
|
@saveButton={{false}}
|
|
@update={{this.fileUploaded}}
|
|
@uploadStarted={{fn (mut this.isUploading) true}}
|
|
@uploadFinished={{fn (mut this.isUploading) false}}
|
|
@accept={{@data.accept}}
|
|
@extensions={{@data.extensions}}
|
|
@uploadUrl={{@data.uploadUrl}}
|
|
@paramsHash={{@data.paramsHas}}
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button class="gh-btn" type="button" {{on "click" @close}}><span>Cancel</span></button>
|
|
{{#if this.isUploading}}
|
|
<button class="gh-btn gh-btn-black right gh-btn-icon disabled" type="button"><span>Save</span></button>
|
|
{{else}}
|
|
<GhTaskButton
|
|
@task={{this.uploadImageTask}}
|
|
@class="gh-btn gh-btn-black right gh-btn-icon"
|
|
data-test-modal-accept-button
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
</div> |