mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
4463f975e3
refs https://github.com/TryGhost/Ghost/issues/9724 - standardised `{{gh-unsplash}}` actions and action arguments to better represent a generic "image source" - added `{{gh-unsplash searchTerm="ghosts"}}` parameter - added `payload` param to `card` definitions used for plus/slash menus so that default payload params can be passed to cards - added a concept of "image selectors" to image card - if a `payload.imageSelector` param is received by the card it will look it up in it's list of known selectors and display the appropriate image selection component - if the card was created with an image selector param and the image selector is closed without selecting an image then the card will be removed - delete image cards during cleanup if they were created via selector but have no src
35 lines
1.2 KiB
Handlebars
35 lines
1.2 KiB
Handlebars
{{#if file}}
|
|
{{!-- Upload in progress! --}}
|
|
{{#if failureMessage}}
|
|
<div class="failed">{{failureMessage}}</div>
|
|
{{/if}}
|
|
<div class="progress-container">
|
|
<div class="progress">
|
|
<div class="bar {{if failureMessage "fail"}}" style={{progressStyle}}></div>
|
|
</div>
|
|
</div>
|
|
{{#if 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">
|
|
{{#gh-file-input multiple=false alt=description action=(action "fileSelected") accept=accept}}
|
|
<div class="gh-btn gh-btn-outline" data-test-file-input-description><span>{{description}}</span></div>
|
|
{{/gh-file-input}}
|
|
|
|
{{#if (and allowUnsplash settings.unsplash.isActive)}}
|
|
<div class="gh-image-uploader-unsplash" {{action (toggle "_showUnsplash" this)}}>
|
|
{{svg-jar "unsplash"}}
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if _showUnsplash}}
|
|
{{gh-unsplash
|
|
select=(action "addUnsplashPhoto")
|
|
close=(action (toggle "_showUnsplash" this))
|
|
}}
|
|
{{/if}}
|