2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.post}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhEditor
|
|
|
|
@tagName="section"
|
|
|
|
@class="gh-editor gh-view"
|
2018-01-17 16:27:37 +03:00
|
|
|
as |editor|
|
2020-01-16 18:14:03 +03:00
|
|
|
>
|
2021-02-15 20:03:07 +03:00
|
|
|
<header class="gh-editor-header br2 pe-none {{editor.headerClass}}">
|
2018-07-26 14:53:23 +03:00
|
|
|
<div class="flex items-center pe-auto">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.ui.isFullScreen}}
|
2021-02-15 20:03:07 +03:00
|
|
|
<div class="ml3 flex items-center">
|
2021-02-08 12:13:26 +03:00
|
|
|
<LinkTo @route={{pluralize this.post.displayName }} @classNames="gh-editor-back-button" data-test-link={{pluralize this.post.displayName}}>
|
|
|
|
<span>
|
|
|
|
{{svg-jar "arrow-left"}}
|
|
|
|
{{capitalize (pluralize this.post.displayName)}}
|
|
|
|
</span>
|
2020-01-16 18:14:03 +03:00
|
|
|
</LinkTo>
|
2018-07-26 14:53:23 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-02-15 20:03:07 +03:00
|
|
|
<div class="gh-editor-post-status">
|
2021-02-08 12:13:26 +03:00
|
|
|
<span>
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhEditorPostStatus
|
|
|
|
@post={{this.post}}
|
|
|
|
@isSaving={{or this.autosave.isRunning this.saveTasks.isRunning}}
|
|
|
|
/>
|
2018-07-20 17:53:21 +03:00
|
|
|
</span>
|
2018-07-26 14:53:23 +03:00
|
|
|
</div>
|
2018-01-17 16:27:37 +03:00
|
|
|
</div>
|
2018-05-15 15:47:50 +03:00
|
|
|
|
2021-02-15 20:03:07 +03:00
|
|
|
<section class="flex" style="pointer-events: auto">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#unless this.post.isNew}}
|
2021-02-01 13:33:05 +03:00
|
|
|
{{#if this.post.isDraft}}
|
2021-02-08 12:13:26 +03:00
|
|
|
<div>
|
2021-02-08 14:50:40 +03:00
|
|
|
<button type="button" class="gh-editor-preview-trigger" {{on "click" (action "togglePostPreviewModal")}}>
|
2021-02-08 12:13:26 +03:00
|
|
|
<span>Preview</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-01 13:33:05 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.session.user.isContributor}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhTaskButton @buttonText="Save"
|
|
|
|
@task={{this.save}}
|
|
|
|
@runningText="Saving"
|
|
|
|
@class="gh-btn gh-btn-blue gh-btn-icon contributor-save-button"
|
|
|
|
data-test-contributor-save=true />
|
2018-02-07 12:42:46 +03:00
|
|
|
{{else}}
|
2021-02-08 12:13:26 +03:00
|
|
|
<div>
|
|
|
|
<GhPublishmenu
|
|
|
|
@post={{this.post}}
|
|
|
|
@postStatus={{this.post.status}}
|
|
|
|
@saveTask={{this.save}}
|
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
@onOpen={{action "cancelAutosave"}}
|
|
|
|
@backgroundTask={{this.backgroundLoader}}
|
|
|
|
@memberCount={{this.memberCount}} />
|
|
|
|
</div>
|
2018-02-07 12:42:46 +03:00
|
|
|
{{/if}}
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/unless}}
|
|
|
|
|
2021-02-08 12:13:26 +03:00
|
|
|
<div>
|
2021-02-10 17:54:30 +03:00
|
|
|
<button type="button" class="gh-btn gh-btn-editor gh-btn-icon only-has-icon gh-actions-cog ml3" title="Settings" data-test-button="psm-toggle" {{action "openSettingsMenu" target=this.ui}} data-test-psm-trigger>
|
2021-02-08 12:13:26 +03:00
|
|
|
<span>{{svg-jar "settings"}}</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2018-01-17 16:27:37 +03:00
|
|
|
</section>
|
|
|
|
</header>
|
|
|
|
|
2018-08-08 19:31:38 +03:00
|
|
|
{{!--
|
|
|
|
gh-koenig-editor acts as a wrapper around the title input and
|
|
|
|
koenig editor canvas to support Ghost-specific editor behaviour
|
|
|
|
--}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhKoenigEditor
|
|
|
|
@title={{readonly this.post.titleScratch}}
|
|
|
|
@titlePlaceholder={{concat (capitalize this.post.displayName) " Title"}}
|
|
|
|
@onTitleChange={{action "updateTitleScratch"}}
|
|
|
|
@onTitleBlur={{action (perform this.saveTitle)}}
|
|
|
|
@body={{readonly this.post.scratch}}
|
|
|
|
@bodyPlaceholder={{concat "Begin writing your " this.post.displayName "..."}}
|
|
|
|
@bodyAutofocus={{this.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"}}
|
2020-10-15 20:03:18 +03:00
|
|
|
@snippets={{this.snippets}}
|
2020-10-27 17:42:36 +03:00
|
|
|
@saveSnippet={{if this.canManageSnippets this.saveSnippet}}
|
|
|
|
@deleteSnippet={{if this.canManageSnippets this.toggleDeleteSnippetModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
/>
|
2018-01-17 16:27:37 +03:00
|
|
|
|
2021-02-10 17:54:30 +03:00
|
|
|
<div class="gh-editor-wordcount-container {{if editor.headerClass "small"}}">
|
2019-06-18 13:47:21 +03:00
|
|
|
<div class="midgrey-l2 {{if editor.headerClass "f-supersmall pl2 pr2" "f8 pl4 pr3"}} fw4">
|
2020-08-10 13:16:03 +03:00
|
|
|
{{gh-pluralize this.wordCount.wordCount "word"}}
|
2018-08-10 14:11:15 +03:00
|
|
|
</div>
|
2021-01-19 03:18:59 +03:00
|
|
|
<a href="https://ghost.org/help/using-the-editor/" class="flex {{if editor.headerClass "pa2" "pa3"}}" target="_blank">{{svg-jar "help" class="w4 h4 stroke-midgrey-l2"}}</a>
|
2018-08-08 19:31:38 +03:00
|
|
|
</div>
|
2018-07-23 14:19:45 +03:00
|
|
|
|
2020-01-16 18:14:03 +03:00
|
|
|
</GhEditor>
|
2018-01-17 16:27:37 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showDeletePostModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="delete-post"
|
2020-02-27 18:19:31 +03:00
|
|
|
@model={{hash post=this.post onSuccess=(route-action 'redirectToContentScreen' this.post.displayName)}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@close={{action "toggleDeletePostModal"}}
|
|
|
|
@modifier="action wide" />
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showLeaveEditorModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="leave-editor"
|
|
|
|
@confirm={{action "leaveEditor"}}
|
|
|
|
@close={{action "toggleLeaveEditorModal"}}
|
|
|
|
@modifier="action wide" />
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/if}}
|
|
|
|
|
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}}
|
|
|
|
|
2021-01-22 12:24:33 +03:00
|
|
|
{{#if this.showPostPreviewModal}}
|
|
|
|
<GhFullscreenModal @modal="post-preview"
|
2021-02-01 20:59:18 +03:00
|
|
|
@model={{hash
|
|
|
|
post=this.post
|
|
|
|
saveTask=this.save
|
|
|
|
setEditorSaveType=(action "setSaveType")
|
|
|
|
memberCount=this.memberCount
|
|
|
|
}}
|
2021-01-22 12:24:33 +03:00
|
|
|
@close={{action "togglePostPreviewModal"}}
|
|
|
|
@modifier="full-overlay email-preview" />
|
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showEmailPreviewModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="post-email-preview"
|
|
|
|
@model={{this.post}}
|
|
|
|
@close={{action "toggleEmailPreviewModal"}}
|
|
|
|
@modifier="full-overlay email-preview" />
|
2019-11-05 08:21:29 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-17 16:57:42 +03:00
|
|
|
{{#if this.showUpgradeModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="upgrade-host-limit"
|
|
|
|
@model={{hash
|
|
|
|
message=hostLimitError.context
|
|
|
|
details=hostLimitError.details
|
|
|
|
upgradeLink=hostLimitError.help
|
|
|
|
}}
|
|
|
|
@close={{action "closeUpgradeModal"}}
|
|
|
|
@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}}
|
|
|
|
|
2020-01-16 18:14:03 +03:00
|
|
|
<LiquidWormhole>
|
|
|
|
<GhPostSettingsMenu
|
|
|
|
@post={{this.post}}
|
|
|
|
@showSettingsMenu={{this.ui.showSettingsMenu}}
|
|
|
|
@toggleEmailPreviewModal={{action "toggleEmailPreviewModal"}}
|
|
|
|
@deletePost={{action "toggleDeletePostModal"}}
|
|
|
|
@updateSlug={{this.updateSlug}}
|
|
|
|
@savePost={{this.savePost}}
|
|
|
|
/>
|
|
|
|
</LiquidWormhole>
|
2018-01-17 16:27:37 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2018-08-08 15:14:02 +03:00
|
|
|
{{outlet}}
|