{{#gh-editor tagName="section" class="gh-editor gh-view" navIsClosed=navIsClosed as |editor| }}
{{gh-editor-post-status post=model isSaving=(or autosave.isRunning saveTasks.isRunning) }}
{{#if scheduleCountdown}} {{/if}}
{{#unless model.isNew}} {{gh-publishmenu post=model saveTask=save setSaveType=(action "setSaveType") onOpen=(action "cancelAutosave")}} {{/unless}}
{{!-- 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 mobiledoc=(readonly model.scratch) isFullScreen=editor.isFullScreen onChange=(action "updateScratch") onFullScreenToggle=(action editor.toggleFullScreen) onPreviewToggle=(action editor.togglePreview) onSplitScreenToggle=(action editor.toggleSplitScreen) onImageFilesSelected=(action editor.uploadImages) showMarkdownHelp=(route-action "toggleMarkdownHelpModal") imageMimeTypes=editor.imageMimeTypes as |markdown| }}
{{gh-textarea model.titleScratch class="gh-editor-title" placeholder="Post Title" tabindex="1" autoExpand=".gh-markdown-editor-pane" update=(action "updateTitle") focusOut=(action (perform saveTitle)) keyEvents=(hash 9=(action markdown.focus 'bottom') 13=(action markdown.focus 'top') ) data-test-editor-title-input=true }} {{markdown.editor}}
{{#if markdown.isSplitScreen}}

{{model.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}} {{/gh-editor}} {{#if showDeletePostModal}} {{gh-fullscreen-modal "delete-post" model=(hash post=model 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 model=model showSettingsMenu=ui.showSettingsMenu deletePost=(action "toggleDeletePostModal") updateSlug=updateSlug }} {{/liquid-wormhole}}