{{#if post}} {{#gh-editor tagName="section" class="gh-editor gh-view" navIsClosed=navIsClosed as |editor| }}
{{#if ui.isFullScreen}}
{{#link-to "posts" classNames="blue link fw4 flex items-center"}} {{svg-jar "arrow-left" class="w3 fill-blue mr1 nudge-right--2"}} Stories {{/link-to}}
{{/if}}
{{gh-editor-post-status post=post isSaving=(or autosave.isRunning saveTasks.isRunning) }} {{#gh-scheduled-post-countdown post=post as |post countdown|}} {{/gh-scheduled-post-countdown}}
{{#if infoMessage}}
{{svg-jar "idea" class="w7 h7 fill-blue"}}

{{infoMessage}}

{{/if}}
{{#unless post.isNew}} {{#if session.user.isContributor}} {{gh-task-button "Save" task=save runningText="Saving" class="gh-btn gh-btn-blue gh-btn-icon contributor-save-button" data-test-contributor-save=true}} {{else}} {{gh-publishmenu post=post postStatus=post.status saveTask=save setSaveType=(action "setSaveType") onOpen=(action "cancelAutosave")}} {{/if}} {{/unless}}
{{#if useKoenig}} {{!-- gh-koenig-editor acts as a wrapper around the title input and koenig editor canvas to support Ghost-specific editor behaviour --}} {{gh-koenig-editor title=(readonly post.titleScratch) titlePlaceholder="Story Title" onTitleChange=(action "updateTitleScratch") onTitleBlur=(action (perform saveTitle)) body=(readonly post.scratch) bodyPlaceholder="Begin writing your story..." bodyAutofocus=shouldFocusEditor onBodyChange=(action "updateScratch") headerOffset=editor.headerHeight scrollContainerSelector=".gh-koenig-editor" scrollOffsetTopSelector=".gh-editor-header-small" scrollOffsetBottomSelector=".gh-mobile-nav-bar" onEditorCreated=(action "setKoenigEditor") onWordCountChange=(action "updateWordCount") }}
{{pluralize wordCount.wordCount "word"}}
{{svg-jar "help" class="w4 h4 stroke-midgrey-l2"}}
{{else}} {{!-- NOTE: title is part of the markdown editor container so that it has access to the markdown editor's "focus" action --}} {{#gh-markdown-editor tabindex="2" placeholder="Begin writing your story..." autofocus=shouldFocusEditor uploadedImageUrls=editor.uploadedImageUrls markdown=(readonly markdown) isFullScreen=editor.isFullScreen onChange=(action "updateMarkdown") onFullScreenToggle=(action editor.toggleFullScreen) onPreviewToggle=(action editor.togglePreview) onSplitScreenToggle=(action editor.toggleSplitScreen) onImageFilesSelected=(action editor.uploadImages) imageMimeTypes=editor.imageMimeTypes as |markdown| }}
{{gh-textarea class="gh-editor-title" placeholder="Post Title" tabindex="1" autoExpand=".gh-markdown-editor-pane" value=(readonly post.titleScratch) input=(action "updateTitleScratch" value="target.value") focus-out=(action (perform saveTitle)) keyEvents=(hash Tab=(action markdown.focus 'bottom') Enter=(action markdown.focus 'top') ) data-test-editor-title-input=true }} {{markdown.editor}}
{{#if markdown.isSplitScreen}}

{{post.titleScratch}}

{{/if}} {{gh-tour-item "using-the-editor" target=".gh-editor-footer" throbberAttachment="top left" throbberOffset="0 20%" popoverTriangleClass="bottom" }} {{/gh-markdown-editor}} {{!-- TODO: put tool/status bar in here so that scroll area can be fixed --}} {{!-- files are dragged over editor pane --}} {{#if editor.isDraggedOver}}

Drop image(s) here to upload

{{/if}} {{!-- files have been dropped ready to be uploaded --}} {{#if editor.droppedFiles}} {{#gh-uploader files=editor.droppedFiles accept=editor.imageMimeTypes extensions=editor.imageExtensions onComplete=(action editor.uploadComplete) onCancel=(action editor.uploadCancelled) as |upload| }}
{{#if upload.errors}}

Upload failed

{{#each upload.errors as |error|}}
{{error.fileName}} - {{error.message}}
{{/each}} {{else}}

Uploading {{pluralize upload.files.length "image"}}...

{{upload.progressBar}} {{/if}}
{{/gh-uploader}} {{/if}} {{/if}} {{!-- end Koenig conditional --}} {{/gh-editor}} {{#if showDeletePostModal}} {{gh-fullscreen-modal "delete-post" model=(hash post=post onSuccess=(route-action 'redirectToContentScreen')) close=(action "toggleDeletePostModal") modifier="action wide"}} {{/if}} {{#if showLeaveEditorModal}} {{gh-fullscreen-modal "leave-editor" confirm=(action "leaveEditor") close=(action "toggleLeaveEditorModal") modifier="action wide"}} {{/if}} {{#if showReAuthenticateModal}} {{gh-fullscreen-modal "re-authenticate" close=(action "toggleReAuthenticateModal") modifier="action wide"}} {{/if}} {{#liquid-wormhole}} {{gh-post-settings-menu post=post showSettingsMenu=ui.showSettingsMenu deletePost=(action "toggleDeletePostModal") updateSlug=updateSlug savePost=savePost }} {{/liquid-wormhole}} {{/if}} {{outlet}}