Ghost/ghost/admin/app/components/gh-image-uploader-with-preview.hbs
Kevin Ansfield ceb16b5e9f Added first version of feature image with caption inside editor (#1999)
refs https://github.com/TryGhost/Team/issues/771

- updated `<GhImageUploaderWithPreview>` to take an `@includeMetadata` argument that shows a basic html supporting caption field underneath (ready for toggle between caption/alt but not fully implemented)
- added feature image alt/caption properties to post model
- updated UI behind "featureImageMeta" labs flag
  - added the feature image uploader to the top of `<GhKoenigEditor>` for display above the editor title
  - removed feature image uploader from post settings menu
- added labs flag checkbox
2021-06-10 20:42:32 +01:00

33 lines
1.0 KiB
Handlebars

{{#if @image}}
<div class="gh-image-uploader -with-image">
<div><img src={{@image}}></div>
<a class="image-cancel" title="Delete" {{on "click" @remove}}>
{{svg-jar "trash"}}
<span class="hidden">Delete</span>
</a>
</div>
{{else}}
<GhImageUploader
@text={{@text}}
@altText={{@altText}}
@allowUnsplash={{@allowUnsplash}}
@update={{@update}}
@uploadStarted={{optional @uploadStarted}}
@uploadFinished={{optional @uploadFinished}}
/>
{{/if}}
{{#if @includeMetadata}}
{{#if this.isEditingAlt}}
{{else}}
<KoenigBasicHtmlInput
@html={{@caption}}
@placeholder={{if this.captionInputFocused "" @captionPlaceholder}}
@class="miw-100 tc bn form-text bg-transparent pr8 pl8"
@name="caption"
@onChange={{@updateCaption}}
@onFocus={{fn (mut this.captionInputFocused) true}}
@onBlur={{fn (mut this.captionInputFocused) false}}
/>
{{/if}}
{{/if}}