2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.post}}
|
2022-05-16 11:39:28 +03:00
|
|
|
<div class="flex flex-row">
|
2021-06-17 21:00:59 +03:00
|
|
|
<GhEditor
|
|
|
|
@tagName="section"
|
|
|
|
@class="gh-editor gh-view relative"
|
|
|
|
as |editor|
|
|
|
|
>
|
2021-07-02 21:03:52 +03:00
|
|
|
<header class="gh-editor-header br2 pe-none">
|
2022-06-01 15:48:33 +03:00
|
|
|
<Editor::PublishManagement
|
|
|
|
@post={{this.post}}
|
|
|
|
@hasUnsavedChanges={{this.hasDirtyAttributes}}
|
|
|
|
@beforePublish={{perform this.beforeSaveTask}}
|
|
|
|
@afterPublish={{this.afterSave}}
|
|
|
|
@saveTask={{this.saveTask}}
|
|
|
|
as |publishManagement|
|
|
|
|
>
|
|
|
|
<div class="flex items-center pe-auto h-100">
|
|
|
|
{{#if this.ui.isFullScreen}}
|
|
|
|
<LinkTo @route={{pluralize this.post.displayName }} class="gh-btn-editor gh-editor-back-button" data-test-link={{pluralize this.post.displayName}}>
|
|
|
|
<span>
|
|
|
|
{{svg-jar "arrow-left"}}
|
|
|
|
{{capitalize (pluralize this.post.displayName)}}
|
|
|
|
</span>
|
|
|
|
</LinkTo>
|
|
|
|
{{/if}}
|
|
|
|
<div class="gh-editor-post-status">
|
2022-05-12 16:03:16 +03:00
|
|
|
<span>
|
2022-06-01 15:48:33 +03:00
|
|
|
<GhEditorPostStatus
|
|
|
|
@post={{this.post}}
|
|
|
|
@hasDirtyAttributes={{this.hasDirtyAttributes}}
|
|
|
|
@isSaving={{or this.autosaveTask.isRunning this.saveTasks.isRunning}}
|
|
|
|
@openUpdateFlow={{publishManagement.openUpdateFlow}}
|
|
|
|
/>
|
2022-05-12 16:03:16 +03:00
|
|
|
</span>
|
2022-06-01 15:48:33 +03:00
|
|
|
</div>
|
2018-07-26 14:53:23 +03:00
|
|
|
</div>
|
2018-05-15 15:47:50 +03:00
|
|
|
|
2022-06-01 15:48:33 +03:00
|
|
|
<section class="flex items-center pe-auto h-100">
|
|
|
|
{{#unless this.post.isNew}}
|
|
|
|
<Editor::PublishButtons @publishManagement={{publishManagement}} />
|
2021-06-17 21:00:59 +03:00
|
|
|
|
2022-06-01 15:48:33 +03:00
|
|
|
{{#unless this.showSettingsMenu}}
|
|
|
|
<div class="settings-menu-toggle-spacer"></div>
|
|
|
|
{{/unless}}
|
2021-06-17 21:00:59 +03:00
|
|
|
{{/unless}}
|
2022-06-01 15:48:33 +03:00
|
|
|
</section>
|
|
|
|
</Editor::PublishManagement>
|
2021-06-17 21:00:59 +03:00
|
|
|
</header>
|
2021-02-01 13:33:05 +03:00
|
|
|
|
2021-06-17 21:00:59 +03:00
|
|
|
{{!--
|
|
|
|
gh-koenig-editor acts as a wrapper around the title input and
|
|
|
|
koenig editor canvas to support Ghost-specific editor behaviour
|
|
|
|
--}}
|
|
|
|
<GhKoenigEditor
|
|
|
|
@title={{readonly this.post.titleScratch}}
|
|
|
|
@titleAutofocus={{this.shouldFocusTitle}}
|
|
|
|
@titlePlaceholder={{concat (capitalize this.post.displayName) " title"}}
|
2022-05-18 11:27:43 +03:00
|
|
|
@onTitleChange={{this.updateTitleScratch}}
|
|
|
|
@onTitleBlur={{perform this.saveTitleTask}}
|
2021-06-17 21:00:59 +03:00
|
|
|
@body={{readonly this.post.scratch}}
|
|
|
|
@bodyPlaceholder={{concat "Begin writing your " this.post.displayName "..."}}
|
2022-05-18 11:27:43 +03:00
|
|
|
@onBodyChange={{this.updateScratch}}
|
2021-06-17 21:00:59 +03:00
|
|
|
@headerOffset={{editor.headerHeight}}
|
|
|
|
@scrollContainerSelector=".gh-koenig-editor"
|
|
|
|
@scrollOffsetBottomSelector=".gh-mobile-nav-bar"
|
2022-05-18 11:27:43 +03:00
|
|
|
@onEditorCreated={{this.setKoenigEditor}}
|
|
|
|
@onWordCountChange={{this.updateWordCount}}
|
2021-06-17 21:00:59 +03:00
|
|
|
@snippets={{this.snippets}}
|
|
|
|
@saveSnippet={{if this.canManageSnippets this.saveSnippet}}
|
2021-08-23 19:12:26 +03:00
|
|
|
@updateSnippet={{if this.canManageSnippets this.toggleUpdateSnippetModal}}
|
2021-06-17 21:00:59 +03:00
|
|
|
@deleteSnippet={{if this.canManageSnippets this.toggleDeleteSnippetModal}}
|
|
|
|
@featureImage={{this.post.featureImage}}
|
|
|
|
@featureImageAlt={{this.post.featureImageAlt}}
|
|
|
|
@featureImageCaption={{this.post.featureImageCaption}}
|
2022-05-18 11:27:43 +03:00
|
|
|
@setFeatureImage={{this.setFeatureImage}}
|
|
|
|
@setFeatureImageAlt={{this.setFeatureImageAlt}}
|
|
|
|
@setFeatureImageCaption={{this.setFeatureImageCaption}}
|
|
|
|
@clearFeatureImage={{this.clearFeatureImage}}
|
2021-08-23 20:42:14 +03:00
|
|
|
@cardOptions={{hash
|
|
|
|
post=this.post
|
|
|
|
}}
|
2021-09-10 11:24:38 +03:00
|
|
|
@postType={{this.post.displayName}}
|
2021-06-17 21:00:59 +03:00
|
|
|
/>
|
2018-01-17 16:27:37 +03:00
|
|
|
|
2021-07-02 21:03:52 +03:00
|
|
|
<div class="gh-editor-wordcount-container">
|
2021-07-05 13:17:35 +03:00
|
|
|
<div class="gh-editor-wordcount">
|
2021-06-17 21:00:59 +03:00
|
|
|
{{gh-pluralize this.wordCount.wordCount "word"}}
|
2021-02-08 12:13:26 +03:00
|
|
|
</div>
|
2022-02-02 19:09:43 +03:00
|
|
|
<a href="https://ghost.org/help/using-the-editor/" class="flex" target="_blank" rel="noopener noreferrer">{{svg-jar "help"}}</a>
|
2018-08-10 14:11:15 +03:00
|
|
|
</div>
|
2018-07-23 14:19:45 +03:00
|
|
|
|
2021-06-17 21:00:59 +03:00
|
|
|
</GhEditor>
|
|
|
|
|
2021-07-02 21:03:52 +03:00
|
|
|
{{#if this.showSettingsMenu}}
|
|
|
|
<GhPostSettingsMenu
|
|
|
|
@post={{this.post}}
|
2022-05-18 11:27:43 +03:00
|
|
|
@deletePost={{this.openDeletePostModal}}
|
2021-07-02 21:03:52 +03:00
|
|
|
@updateSlugTask={{this.updateSlugTask}}
|
|
|
|
@savePostTask={{this.savePostTask}}
|
|
|
|
/>
|
2021-06-17 21:00:59 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2021-07-23 17:05:22 +03:00
|
|
|
<button type="button" class="settings-menu-toggle gh-btn gh-btn-editor gh-btn-icon icon-only gh-btn-action-icon" title="Settings" {{on "click" this.toggleSettingsMenu}} data-test-psm-trigger>
|
2021-07-02 21:03:52 +03:00
|
|
|
{{#if this.showSettingsMenu}}
|
|
|
|
<span class="settings-menu-open">{{svg-jar "sidemenu-open"}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span>{{svg-jar "sidemenu"}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
2018-01-17 16:27:37 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showReAuthenticateModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="re-authenticate"
|
2022-05-18 11:27:43 +03:00
|
|
|
@close={{this.toggleReAuthenticateModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@modifier="action wide" />
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-17 16:57:42 +03:00
|
|
|
{{#if this.showUpgradeModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="upgrade-host-limit"
|
|
|
|
@model={{hash
|
2022-02-02 20:09:02 +03:00
|
|
|
message=this.hostLimitError.context
|
|
|
|
details=this.hostLimitError.details
|
2019-12-17 16:57:42 +03:00
|
|
|
}}
|
2022-05-18 11:27:43 +03:00
|
|
|
@close={{this.closeUpgradeModal}}
|
2019-12-17 16:57:42 +03:00
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
2021-08-23 19:12:26 +03:00
|
|
|
{{#if this.snippetToUpdate}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="update-snippet"
|
|
|
|
@model={{this.snippetToUpdate}}
|
|
|
|
@confirm={{this.updateSnippet}}
|
|
|
|
@close={{this.toggleUpdateSnippetModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-10-26 20:09:09 +03:00
|
|
|
{{#if this.snippetToDelete}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="delete-snippet"
|
|
|
|
@model={{this.snippetToDelete}}
|
2020-10-27 17:42:36 +03:00
|
|
|
@confirm={{this.deleteSnippet}}
|
2020-10-27 21:33:31 +03:00
|
|
|
@close={{this.toggleDeleteSnippetModal}}
|
2020-10-26 20:09:09 +03:00
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2018-08-08 15:14:02 +03:00
|
|
|
{{outlet}}
|