2022-08-23 13:45:50 +03:00
|
|
|
{{#if this.post}}
|
|
|
|
<div class="flex flex-row">
|
|
|
|
<GhEditor
|
|
|
|
@tagName="section"
|
|
|
|
@class="gh-editor gh-view relative"
|
|
|
|
as |editor|
|
|
|
|
>
|
|
|
|
<header class="gh-editor-header br2 pe-none">
|
|
|
|
<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}}
|
2022-11-11 12:48:07 +03:00
|
|
|
{{#if this.fromAnalytics }}
|
|
|
|
<LinkTo @route="posts.analytics" @model={{this.post}} class="gh-btn-editor gh-editor-back-button">
|
|
|
|
<span>
|
|
|
|
{{svg-jar "arrow-left"}}
|
|
|
|
Analytics
|
|
|
|
</span>
|
|
|
|
</LinkTo>
|
|
|
|
{{else}}
|
|
|
|
<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}}
|
|
|
|
{{/if}}
|
|
|
|
{{#if (or (not this.ui.isFullScreen) (not this.fromAnalytics) this.post.didEmailFail) }}
|
|
|
|
<div class="gh-editor-post-status">
|
2022-08-23 13:45:50 +03:00
|
|
|
<span>
|
2022-11-11 12:48:07 +03:00
|
|
|
<GhEditorPostStatus
|
|
|
|
@post={{this.post}}
|
|
|
|
@publishManagement={{publishManagement}}
|
|
|
|
@hasDirtyAttributes={{this.hasDirtyAttributes}}
|
|
|
|
@isSaving={{or this.autosaveTask.isRunning this.saveTasks.isRunning}}
|
|
|
|
@openUpdateFlow={{publishManagement.openUpdateFlow}}
|
|
|
|
/>
|
2022-08-23 13:45:50 +03:00
|
|
|
</span>
|
2022-11-11 12:48:07 +03:00
|
|
|
</div>
|
2022-08-23 13:45:50 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<section class="flex items-center pe-auto h-100">
|
|
|
|
{{#unless this.post.isNew}}
|
|
|
|
<Editor::PublishButtons @publishManagement={{publishManagement}} />
|
|
|
|
{{#unless this.showSettingsMenu}}
|
|
|
|
<div class="settings-menu-toggle-spacer"></div>
|
|
|
|
{{/unless}}
|
|
|
|
{{/unless}}
|
|
|
|
</section>
|
|
|
|
</Editor::PublishManagement>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
{{!--
|
|
|
|
gh-koenig-editor acts as a wrapper around the title input and
|
|
|
|
koenig editor canvas to support Ghost-specific editor behaviour
|
|
|
|
--}}
|
|
|
|
<GhKoenigEditorLexical
|
|
|
|
@title={{readonly this.post.titleScratch}}
|
|
|
|
@titleAutofocus={{this.shouldFocusTitle}}
|
|
|
|
@titlePlaceholder={{concat (capitalize this.post.displayName) " title"}}
|
|
|
|
@onTitleChange={{this.updateTitleScratch}}
|
|
|
|
@onTitleBlur={{perform this.saveTitleTask}}
|
2022-09-13 23:01:53 +03:00
|
|
|
@body={{readonly this.post.lexicalScratch}}
|
2022-08-23 13:45:50 +03:00
|
|
|
@bodyPlaceholder={{concat "Begin writing your " this.post.displayName "..."}}
|
|
|
|
@onBodyChange={{this.updateScratch}}
|
|
|
|
@headerOffset={{editor.headerHeight}}
|
|
|
|
@scrollContainerSelector=".gh-koenig-editor"
|
|
|
|
@scrollOffsetBottomSelector=".gh-mobile-nav-bar"
|
|
|
|
@onEditorCreated={{this.setKoenigEditor}}
|
|
|
|
@onWordCountChange={{this.updateWordCount}}
|
|
|
|
@featureImage={{this.post.featureImage}}
|
|
|
|
@featureImageAlt={{this.post.featureImageAlt}}
|
|
|
|
@featureImageCaption={{this.post.featureImageCaption}}
|
|
|
|
@setFeatureImage={{this.setFeatureImage}}
|
|
|
|
@setFeatureImageAlt={{this.setFeatureImageAlt}}
|
|
|
|
@setFeatureImageCaption={{this.setFeatureImageCaption}}
|
|
|
|
@clearFeatureImage={{this.clearFeatureImage}}
|
|
|
|
@cardOptions={{hash
|
|
|
|
post=this.post
|
2023-04-14 15:08:48 +03:00
|
|
|
snippets=this.snippets
|
2023-04-17 16:39:04 +03:00
|
|
|
deleteSnippet=(if this.canManageSnippets this.confirmDeleteSnippet)
|
|
|
|
createSnippet=(if this.canManageSnippets this.createSnippet)
|
2022-08-23 13:45:50 +03:00
|
|
|
}}
|
|
|
|
@postType={{this.post.displayName}}
|
2023-04-20 13:43:22 +03:00
|
|
|
@registerAPI={{this.registerEditorAPI}}
|
2022-08-23 13:45:50 +03:00
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="gh-editor-wordcount-container">
|
|
|
|
<div class="gh-editor-wordcount">
|
|
|
|
{{gh-pluralize this.wordCount.wordCount "word"}}
|
|
|
|
</div>
|
2022-09-19 17:40:19 +03:00
|
|
|
<a href="https://github.com/TryGhost/Koenig/tree/main/packages/koenig-lexical" target="_blank" rel="noopener noreferrer" class="gh-lexical-indicator">Lexical</a>
|
|
|
|
{{!-- <a href="https://ghost.org/help/using-the-editor/" class="flex" target="_blank" rel="noopener noreferrer">{{svg-jar "help"}}</a> --}}
|
2022-08-23 13:45:50 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</GhEditor>
|
|
|
|
|
|
|
|
{{#if this.showSettingsMenu}}
|
|
|
|
<GhPostSettingsMenu
|
|
|
|
@post={{this.post}}
|
|
|
|
@deletePost={{this.openDeletePostModal}}
|
|
|
|
@updateSlugTask={{this.updateSlugTask}}
|
|
|
|
@savePostTask={{this.savePostTask}}
|
2023-04-20 13:43:22 +03:00
|
|
|
@editorAPI={{this.editorAPI}}
|
2023-04-20 19:01:17 +03:00
|
|
|
@toggleSettingsMenu={{this.toggleSettingsMenu}}
|
2022-08-23 13:45:50 +03:00
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
{{#if this.showSettingsMenu}}
|
|
|
|
<span class="settings-menu-open">{{svg-jar "sidemenu-open"}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span>{{svg-jar "sidemenu"}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
{{#if this.showReAuthenticateModal}}
|
|
|
|
<GhFullscreenModal @modal="re-authenticate"
|
|
|
|
@close={{this.toggleReAuthenticateModal}}
|
|
|
|
@modifier="action wide" />
|
|
|
|
{{/if}}
|
2023-04-18 13:12:35 +03:00
|
|
|
{{#if (feature 'postHistory')}}
|
|
|
|
{{#if this.showPostHistory}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="post-history"
|
|
|
|
@model={{this.post}}
|
|
|
|
@close={{this.closePostHistory}}
|
|
|
|
@modifier="total-overlay post-history" />
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2022-08-23 13:45:50 +03:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{outlet}}
|