Ghost/ghost/admin/app/components/settings/staff/modals/upload-image.hbs
Rishabh Garg 48030c3050
Added basic image editing alpha feature (#16669)
refs https://github.com/TryGhost/Team/issues/3034

- adds new alpha feature flag for image editing in Admin
- allows new config for Pintura files that enable the image editing in
Admin
- adds new ember component for triggering image editing for post feature
images

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
2023-04-19 16:27:26 +05:30

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-action 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>