2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.post}}
|
2022-01-16 16:48:58 +03:00
|
|
|
<div class="flex flex-row" {{on-key "cmd+p" (action "openPostPreview")}}>
|
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-05-12 14:56:43 +03:00
|
|
|
<div class="flex items-center pe-auto h-100">
|
2021-06-17 21:00:59 +03:00
|
|
|
{{#if this.ui.isFullScreen}}
|
2022-05-12 16:03:16 +03:00
|
|
|
<LinkTo @route={{pluralize this.post.displayName }} class="gh-editor-back-button" data-test-link={{pluralize this.post.displayName}}>
|
|
|
|
<span>
|
|
|
|
{{svg-jar "arrow-left"}}
|
|
|
|
{{capitalize (pluralize this.post.displayName)}}
|
|
|
|
</span>
|
|
|
|
</LinkTo>
|
2021-06-17 21:00:59 +03:00
|
|
|
{{/if}}
|
|
|
|
<div class="gh-editor-post-status">
|
|
|
|
<span>
|
|
|
|
<GhEditorPostStatus
|
|
|
|
@post={{this.post}}
|
2021-07-07 13:37:52 +03:00
|
|
|
@hasDirtyAttributes={{this.hasDirtyAttributes}}
|
2021-06-21 17:05:29 +03:00
|
|
|
@isSaving={{or this.autosaveTask.isRunning this.saveTasks.isRunning}}
|
2021-06-17 21:00:59 +03:00
|
|
|
/>
|
|
|
|
</span>
|
2018-07-26 14:53:23 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-15 15:47:50 +03:00
|
|
|
|
2021-06-17 21:00:59 +03:00
|
|
|
<section class="flex" style="pointer-events: auto">
|
|
|
|
{{#unless this.post.isNew}}
|
2022-05-12 01:46:01 +03:00
|
|
|
{{#if (and this.post.isDraft (not (feature "publishingFlow")))}}
|
2021-06-17 21:00:59 +03:00
|
|
|
<div>
|
2021-09-08 16:29:33 +03:00
|
|
|
<button type="button" class="gh-btn gh-editor-preview-trigger" {{on "click" (action "openPostPreviewModal")}}>
|
2021-06-17 21:00:59 +03:00
|
|
|
<span>Preview</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if this.session.user.isContributor}}
|
|
|
|
<GhTaskButton @buttonText="Save"
|
|
|
|
@task={{this.save}}
|
|
|
|
@runningText="Saving"
|
2022-02-01 20:59:20 +03:00
|
|
|
@class="gh-btn gh-btn-icon gh-btn-editor contributor-save-button"
|
2022-04-20 20:41:29 +03:00
|
|
|
data-test-contributor-save />
|
2021-06-17 21:00:59 +03:00
|
|
|
{{else}}
|
2022-04-20 20:41:29 +03:00
|
|
|
{{#if (feature "publishingFlow")}}
|
2022-05-04 12:30:37 +03:00
|
|
|
<EditorLabs::PublishManagement
|
|
|
|
@post={{this.post}}
|
2022-05-10 12:04:14 +03:00
|
|
|
@hasUnsavedChanges={{this.hasDirtyAttributes}}
|
|
|
|
@beforePublish={{perform this.beforeSaveTask}}
|
|
|
|
@afterPublish={{this.afterSave}}
|
|
|
|
@saveTask={{this.saveTask}}
|
2022-05-04 12:30:37 +03:00
|
|
|
/>
|
2022-04-20 20:41:29 +03:00
|
|
|
{{else}}
|
|
|
|
<GhPublishmenu
|
|
|
|
@post={{this.post}}
|
|
|
|
@postStatus={{this.post.status}}
|
|
|
|
@saveTask={{this.saveTask}}
|
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
@onOpen={{action "cancelAutosave"}} />
|
|
|
|
{{/if}}
|
2021-06-17 21:00:59 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2021-07-02 21:03:52 +03:00
|
|
|
{{#unless this.showSettingsMenu}}
|
|
|
|
<div class="settings-menu-toggle-spacer"></div>
|
2021-06-17 21:00:59 +03:00
|
|
|
{{/unless}}
|
2021-07-02 21:03:52 +03:00
|
|
|
{{/unless}}
|
2021-06-17 21:00:59 +03:00
|
|
|
</section>
|
|
|
|
</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"}}
|
|
|
|
@onTitleChange={{action "updateTitleScratch"}}
|
|
|
|
@onTitleBlur={{action (perform this.saveTitleTask)}}
|
|
|
|
@body={{readonly this.post.scratch}}
|
|
|
|
@bodyPlaceholder={{concat "Begin writing your " this.post.displayName "..."}}
|
|
|
|
@onBodyChange={{action "updateScratch"}}
|
|
|
|
@headerOffset={{editor.headerHeight}}
|
|
|
|
@scrollContainerSelector=".gh-koenig-editor"
|
|
|
|
@scrollOffsetBottomSelector=".gh-mobile-nav-bar"
|
|
|
|
@onEditorCreated={{action "setKoenigEditor"}}
|
|
|
|
@onWordCountChange={{action "updateWordCount"}}
|
|
|
|
@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}}
|
|
|
|
@setFeatureImage={{action "setFeatureImage"}}
|
|
|
|
@setFeatureImageAlt={{action "setFeatureImageAlt"}}
|
|
|
|
@setFeatureImageCaption={{action "setFeatureImageCaption"}}
|
|
|
|
@clearFeatureImage={{action "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}}
|
2021-09-03 20:24:46 +03:00
|
|
|
@deletePost={{action "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"
|
|
|
|
@close={{action "toggleReAuthenticateModal"}}
|
|
|
|
@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
|
|
|
}}
|
|
|
|
@close={{action "closeUpgradeModal"}}
|
|
|
|
@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}}
|