mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
5573d72e65
closes TryGhost/Ghost#7064 - pull alt text from parsed markdown - move text to image uploader component proper
44 lines
1.7 KiB
Handlebars
44 lines
1.7 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="btn btn-green" {{action "reset"}}>Try Again</button>
|
|
{{/if}}
|
|
{{else}}
|
|
{{#if showUploadForm}}
|
|
{{!-- file selection/drag-n-drop --}}
|
|
<div class="upload-form">
|
|
{{#gh-file-input multiple=false alt=text action=(action 'fileSelected') accept="image/gif,image/jpg,image/jpeg,image/png,image/svg+xml"}}
|
|
<div class="description">{{if text (concat "Upload image of " text) "Upload an image"}}</div>
|
|
{{/gh-file-input}}
|
|
</div>
|
|
|
|
<a class="image-url" {{action 'switchForm' 'url-input'}}>
|
|
<i class="icon-link"><span class="hidden">URL</span></i>
|
|
</a>
|
|
{{else}}
|
|
{{!-- URL input --}}
|
|
<form class="url-form">
|
|
{{gh-input url class="url" placeholder="http://" update=(action "onInput") onenter=(action "saveUrl")}}
|
|
{{#if saveButton}}
|
|
<button class="btn btn-blue gh-input" {{action 'saveUrl'}}>Save</button>
|
|
{{else}}
|
|
<div class="description">{{if text (concat "Upload image of " text) "Upload an image"}}</div>
|
|
{{/if}}
|
|
</form>
|
|
|
|
{{#if canShowUploadForm}}
|
|
<a class="image-upload icon-photos" title="Add image" {{action 'switchForm' 'upload'}}>
|
|
<span class="hidden">Upload</span>
|
|
</a>
|
|
{{/if}}
|
|
{{/if}}
|
|
{{/if}}
|