2014-10-13 19:23:06 +04:00
|
|
|
|
{{#gh-tabs-manager selected="showSubview" id="entry-controls" class="settings-menu-container"}}
|
|
|
|
|
<div id="entry-controls">
|
2015-04-01 19:01:38 +03:00
|
|
|
|
<div class="{{if isViewingSubview 'settings-menu-pane-out-left' 'settings-menu-pane-in'}} settings-menu settings-menu-pane">
|
2014-10-13 19:23:06 +04:00
|
|
|
|
<div class="settings-menu-header">
|
2014-09-04 17:56:07 +04:00
|
|
|
|
<h4>Post Settings</h4>
|
2017-04-24 10:29:41 +03:00
|
|
|
|
<button class="close settings-menu-header-action" {{action "closeMenus"}} data-test-close-settings-menu>
|
|
|
|
|
{{inline-svg "close"}}<span class="hidden">Close</span>
|
|
|
|
|
</button>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</div>
|
2014-10-13 19:23:06 +04:00
|
|
|
|
<div class="settings-menu-content">
|
2016-02-26 16:25:47 +03:00
|
|
|
|
{{gh-image-uploader-with-preview
|
2017-04-24 20:22:39 +03:00
|
|
|
|
image=model.featureImage
|
2016-02-26 16:25:47 +03:00
|
|
|
|
text="Add post image"
|
|
|
|
|
update=(action "setCoverImage")
|
2016-07-24 12:19:49 +03:00
|
|
|
|
remove=(action "clearCoverImage")
|
|
|
|
|
}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
<form>
|
|
|
|
|
<div class="form-group">
|
2014-10-16 19:45:44 +04:00
|
|
|
|
<label for="url">Post URL</label>
|
2015-05-01 12:13:39 +03:00
|
|
|
|
{{#if model.isPublished}}
|
|
|
|
|
<a class="post-view-link" target="_blank" href="{{model.absoluteUrl}}">
|
2017-04-07 18:23:45 +03:00
|
|
|
|
View post {{inline-svg "external"}}
|
2015-05-01 12:13:39 +03:00
|
|
|
|
</a>
|
|
|
|
|
{{else}}
|
|
|
|
|
<a class="post-view-link" target="_blank" href="{{model.previewUrl}}">
|
2017-04-07 18:23:45 +03:00
|
|
|
|
Preview {{inline-svg "external"}}
|
2015-04-16 22:40:32 +03:00
|
|
|
|
</a>
|
|
|
|
|
{{/if}}
|
2015-05-01 12:13:39 +03:00
|
|
|
|
|
2017-04-14 19:22:14 +03:00
|
|
|
|
<div class="gh-input-icon gh-icon-link">
|
|
|
|
|
{{inline-svg "link"}}
|
2016-07-01 17:30:13 +03:00
|
|
|
|
{{gh-input slugValue class="post-setting-slug" id="url" name="post-setting-slug" focusOut=(action "updateSlug" slugValue) stopEnterKeyDownPropagation="true" update=(action (mut slugValue))}}
|
2017-04-14 19:22:14 +03:00
|
|
|
|
</div>
|
2014-11-28 13:15:48 +03:00
|
|
|
|
{{gh-url-preview slug=slugValue tagName="p" classNames="description"}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</div>
|
2014-08-16 01:18:36 +04:00
|
|
|
|
|
2017-04-11 16:39:45 +03:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
{{#if (or model.isDraft model.isPublished model.pastScheduledTime)}}
|
|
|
|
|
<label>Publish Date</label>
|
Scheduler UI
refs TryGhost/Ghost#6413 and TryGhost/Ghost#6870
needs TryGhost/Ghost#6861
- **Post Settings Menu (PSM)**:'Publish Date' input accepts a date from now, min. 2 minutes to allow scheduler processing on the server. Also, there will always be some delay between typing the date and clicking on the 'Schedule Post' button. If the user types a future date for an already published post, the date will be reseted and he sees the message, that the post needs to be unpublished first. Once, the date is accepted, the label will change to 'Scheduled Date'.
- adds a CP 'timeScheduled' to post model, which will return `true` if the publish time is currently in the future.
- **Changes to the button flow in editor**:
- if the the CP `timeScheduled` returns true, a different drop-down-menu will be shown: 'Schedule Post' replaces 'Publish Now' and 'Unschedule' replaces 'Unpublish'.
- Covering the _edge cases_, especially when a scheduled post is about to be published, while the user is in the editor.
- First, a new CP `scheduleCountdown` will return the remaining time, when the estimated publish time is 15 minutes from now. A notification with this live-ticker is shown next to the save button. Once, we reach a 2 minutes limit, another CP `statusFreeze` will return true and causes the save button to only show `Unschedule` in a red state, until we reach the publish time
- Once the publish time is reached, a CP `scheduledWillPublish` causes the buttons and the existing code to pretend we're already dealing with a publish post. At the moment, there's no way to make a background-fetch of the now serverside-scheduled post model from the server, so Ember doesn't know about the changed state at that time.
- Changes in the editor, which are done during this 'status freeze'-process will be saved back correctly, once the user hits 'Update Post' after the buttons changed back. A click on 'Unpublish' will change the status back to a draft.
- The user will get a regular 'toaster' notification that the post has been published.
- adds CP `isScheduled` for scheduled posts
- adds CP `offset` to component `gh-posts-list-item` and helper `gh-format-time-scheduled` to show schedule date in content overview.
- sets timeout in `gh-spin-button` to 10ms for `Ember.testing`
- changes error message in `gh-editor-base-controller` to be in one line, seperated with a `:`
TODOs:
- [x] new sort order for posts (1. scheduled, 2. draft, 3. published) (refs TryGhost/Ghost#6932)
- [ ] Move posts sorting from posts controller to model and refactor to use `Ember.comparable` mixin
- [x] Flows for draft -> scheduled -> published like described in TryGhost/Ghost#6870 incl. edge cases and button behaviour
- [x] Tests
- [x] new PSM behaviour for time/date in future
- [x] display publishedAt date with timezone offset on posts overview
2016-02-02 10:04:40 +03:00
|
|
|
|
{{else}}
|
2017-04-11 16:39:45 +03:00
|
|
|
|
<label>Scheduled Date</label>
|
|
|
|
|
<p>Use the publish menu to re-schedule</p>
|
Scheduler UI
refs TryGhost/Ghost#6413 and TryGhost/Ghost#6870
needs TryGhost/Ghost#6861
- **Post Settings Menu (PSM)**:'Publish Date' input accepts a date from now, min. 2 minutes to allow scheduler processing on the server. Also, there will always be some delay between typing the date and clicking on the 'Schedule Post' button. If the user types a future date for an already published post, the date will be reseted and he sees the message, that the post needs to be unpublished first. Once, the date is accepted, the label will change to 'Scheduled Date'.
- adds a CP 'timeScheduled' to post model, which will return `true` if the publish time is currently in the future.
- **Changes to the button flow in editor**:
- if the the CP `timeScheduled` returns true, a different drop-down-menu will be shown: 'Schedule Post' replaces 'Publish Now' and 'Unschedule' replaces 'Unpublish'.
- Covering the _edge cases_, especially when a scheduled post is about to be published, while the user is in the editor.
- First, a new CP `scheduleCountdown` will return the remaining time, when the estimated publish time is 15 minutes from now. A notification with this live-ticker is shown next to the save button. Once, we reach a 2 minutes limit, another CP `statusFreeze` will return true and causes the save button to only show `Unschedule` in a red state, until we reach the publish time
- Once the publish time is reached, a CP `scheduledWillPublish` causes the buttons and the existing code to pretend we're already dealing with a publish post. At the moment, there's no way to make a background-fetch of the now serverside-scheduled post model from the server, so Ember doesn't know about the changed state at that time.
- Changes in the editor, which are done during this 'status freeze'-process will be saved back correctly, once the user hits 'Update Post' after the buttons changed back. A click on 'Unpublish' will change the status back to a draft.
- The user will get a regular 'toaster' notification that the post has been published.
- adds CP `isScheduled` for scheduled posts
- adds CP `offset` to component `gh-posts-list-item` and helper `gh-format-time-scheduled` to show schedule date in content overview.
- sets timeout in `gh-spin-button` to 10ms for `Ember.testing`
- changes error message in `gh-editor-base-controller` to be in one line, seperated with a `:`
TODOs:
- [x] new sort order for posts (1. scheduled, 2. draft, 3. published) (refs TryGhost/Ghost#6932)
- [ ] Move posts sorting from posts controller to model and refactor to use `Ember.comparable` mixin
- [x] Flows for draft -> scheduled -> published like described in TryGhost/Ghost#6870 incl. edge cases and button behaviour
- [x] Tests
- [x] new PSM behaviour for time/date in future
- [x] display publishedAt date with timezone offset on posts overview
2016-02-02 10:04:40 +03:00
|
|
|
|
{{/if}}
|
2017-04-11 16:39:45 +03:00
|
|
|
|
{{gh-date-time-picker
|
|
|
|
|
date=model.publishedAtBlogDate
|
|
|
|
|
time=model.publishedAtBlogTime
|
|
|
|
|
setDate=(action "setPublishedAtBlogDate")
|
|
|
|
|
setTime=(action "setPublishedAtBlogTime")
|
|
|
|
|
errors=model.errors
|
|
|
|
|
dateErrorProperty="publishedAtBlogDate"
|
|
|
|
|
timeErrorProperty="publishedAtBlogTime"
|
|
|
|
|
maxDate='now'
|
|
|
|
|
disabled=model.isScheduled
|
|
|
|
|
static=true
|
2016-06-18 14:44:23 +03:00
|
|
|
|
}}
|
2017-04-11 16:39:45 +03:00
|
|
|
|
</div>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
|
2015-08-10 16:22:37 +03:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="tag-input">Tags</label>
|
2015-08-26 23:19:33 +03:00
|
|
|
|
{{gh-selectize
|
2015-08-19 12:16:32 +03:00
|
|
|
|
id="tag-input"
|
|
|
|
|
multiple=true
|
2016-02-18 20:57:18 +03:00
|
|
|
|
selection=model.tags
|
2015-08-19 12:16:32 +03:00
|
|
|
|
content=availableTags
|
2015-08-26 01:52:45 +03:00
|
|
|
|
optionValuePath="content.uuid"
|
2015-08-19 12:16:32 +03:00
|
|
|
|
optionLabelPath="content.name"
|
2015-09-01 11:53:10 +03:00
|
|
|
|
openOnFocus=false
|
2015-08-19 12:16:32 +03:00
|
|
|
|
create-item="addTag"
|
2015-10-26 19:02:28 +03:00
|
|
|
|
remove-item="removeTag"
|
|
|
|
|
plugins="remove_button, drag_drop"}}
|
2015-08-10 16:22:37 +03:00
|
|
|
|
</div>
|
|
|
|
|
|
2014-09-28 14:21:09 +04:00
|
|
|
|
{{#unless session.user.isAuthor}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
<div class="form-group for-select">
|
2014-10-16 19:45:44 +04:00
|
|
|
|
<label for="author-list">Author</label>
|
2017-04-14 19:22:14 +03:00
|
|
|
|
<span class="gh-input-icon gh-icon-user">
|
|
|
|
|
{{inline-svg "user-circle"}}
|
2014-09-17 14:41:34 +04:00
|
|
|
|
<span class="gh-select" tabindex="0">
|
2016-09-26 19:39:43 +03:00
|
|
|
|
{{one-way-select
|
2017-03-14 06:27:57 +03:00
|
|
|
|
selectedAuthor
|
2014-10-16 19:45:44 +04:00
|
|
|
|
id="author-list"
|
2016-09-26 19:39:43 +03:00
|
|
|
|
name="post-setting-author"
|
|
|
|
|
options=authors
|
2015-06-13 17:34:09 +03:00
|
|
|
|
optionValuePath="id"
|
|
|
|
|
optionLabelPath="name"
|
2016-09-26 19:39:43 +03:00
|
|
|
|
update=(action "changeAuthor")
|
2015-06-13 17:34:09 +03:00
|
|
|
|
}}
|
2017-04-14 19:22:14 +03:00
|
|
|
|
{{inline-svg "arrow-down-small"}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</span>
|
2014-08-16 01:18:36 +04:00
|
|
|
|
</span>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</div>
|
2014-09-28 14:21:09 +04:00
|
|
|
|
{{/unless}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
|
|
|
|
|
<ul class="nav-list nav-list-block">
|
2014-09-15 04:40:24 +04:00
|
|
|
|
{{#gh-tab tagName="li" classNames="nav-list-item"}}
|
2014-11-05 16:38:07 +03:00
|
|
|
|
<button type="button">
|
2014-09-15 04:40:24 +04:00
|
|
|
|
<b>Meta Data</b>
|
|
|
|
|
<span>Extra content for SEO and social media.</span>
|
2014-11-05 16:38:07 +03:00
|
|
|
|
</button>
|
2017-04-07 18:23:45 +03:00
|
|
|
|
{{inline-svg "arrow-right"}}
|
2014-09-15 04:40:24 +04:00
|
|
|
|
{{/gh-tab}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</ul>
|
2014-09-23 12:47:35 +04:00
|
|
|
|
|
|
|
|
|
<div class="form-group for-checkbox">
|
|
|
|
|
<label class="checkbox" for="static-page" {{action "togglePage" bubbles="false"}}>
|
2016-06-18 14:44:23 +03:00
|
|
|
|
{{one-way-checkbox model.page type="checkbox" name="static-page" id="static-page" class="gh-input post-setting-static-page" update=(action (mut model.page))}}
|
2014-09-23 12:47:35 +04:00
|
|
|
|
<span class="input-toggle-component"></span>
|
|
|
|
|
<p>Turn this post into a static page</p>
|
|
|
|
|
</label>
|
|
|
|
|
|
2014-10-16 19:45:44 +04:00
|
|
|
|
<label class="checkbox" for="featured" {{action "toggleFeatured" bubbles="false"}}>
|
2016-06-18 14:44:23 +03:00
|
|
|
|
{{one-way-checkbox model.featured type="checkbox" name="featured" id="featured" class="gh-input post-setting-featured" update=(action (mut model.featured))}}
|
2014-09-23 12:47:35 +04:00
|
|
|
|
<span class="input-toggle-component"></span>
|
|
|
|
|
<p>Feature this post</p>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
2014-10-13 19:23:06 +04:00
|
|
|
|
|
2017-04-19 12:46:42 +03:00
|
|
|
|
{{#unless model.isNew}}
|
2017-04-19 13:00:05 +03:00
|
|
|
|
<button type="button" class="gh-btn gh-btn-link gh-btn-sm gh-btn-icon settings-menu-delete-button" {{action "deletePost"}}><span>{{inline-svg "trash"}} Delete Post</span></button>
|
2017-04-19 12:46:42 +03:00
|
|
|
|
{{/unless}}
|
|
|
|
|
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</form>
|
2014-10-13 19:23:06 +04:00
|
|
|
|
</div>{{! .settings-menu-content }}
|
|
|
|
|
</div>{{! .post-settings-menu }}
|
|
|
|
|
|
2015-04-01 19:01:38 +03:00
|
|
|
|
<div class="{{if isViewingSubview 'settings-menu-pane-in' 'settings-menu-pane-out-right'}} settings-menu settings-menu-pane">
|
2014-09-19 03:42:07 +04:00
|
|
|
|
{{#gh-tab-pane}}
|
2015-03-16 20:55:56 +03:00
|
|
|
|
{{#if isViewingSubview}}
|
2014-10-13 19:23:06 +04:00
|
|
|
|
<div class="settings-menu-header subview">
|
2017-04-14 19:22:14 +03:00
|
|
|
|
<button {{action "closeSubview"}} class="back settings-menu-header-action">{{inline-svg "arrow-left"}}<span class="hidden">Back</span></button>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
<h4>Meta Data</h4>
|
2015-05-18 19:30:59 +03:00
|
|
|
|
<div style="width:23px;">{{!flexbox space-between}}</div>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</div>
|
|
|
|
|
|
2014-10-13 19:23:06 +04:00
|
|
|
|
<div class="settings-menu-content">
|
2015-09-24 20:49:36 +03:00
|
|
|
|
<form {{action "discardEnter" on="submit"}}>
|
2016-08-07 06:52:46 +03:00
|
|
|
|
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="metaTitle"}}
|
2014-10-16 19:45:44 +04:00
|
|
|
|
<label for="meta-title">Meta Title</label>
|
2016-06-25 12:29:03 +03:00
|
|
|
|
{{gh-input metaTitleScratch class="post-setting-meta-title" id="meta-title" name="post-setting-meta-title" focusOut=(action "setMetaTitle" metaTitleScratch) stopEnterKeyDownPropagation="true" update=(action (mut metaTitleScratch))}}
|
2014-09-21 22:56:30 +04:00
|
|
|
|
<p>Recommended: <b>70</b> characters. You’ve used {{gh-count-down-characters metaTitleScratch 70}}</p>
|
2016-01-23 21:12:22 +03:00
|
|
|
|
{{gh-error-message errors=model.errors property="metaTitle"}}
|
2015-08-29 22:02:06 +03:00
|
|
|
|
{{/gh-form-group}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
|
2016-08-07 06:52:46 +03:00
|
|
|
|
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="metaDescription"}}
|
2014-10-16 19:45:44 +04:00
|
|
|
|
<label for="meta-description">Meta Description</label>
|
2016-06-25 12:29:03 +03:00
|
|
|
|
{{gh-textarea metaDescriptionScratch class="post-setting-meta-description" id="meta-description" name="post-setting-meta-description" focusOut=(action "setMetaDescription" metaDescriptionScratch) stopEnterKeyDownPropagation="true" update=(action (mut metaDescriptionScratch))}}
|
2014-09-21 22:56:30 +04:00
|
|
|
|
<p>Recommended: <b>156</b> characters. You’ve used {{gh-count-down-characters metaDescriptionScratch 156}}</p>
|
2016-01-23 21:12:22 +03:00
|
|
|
|
{{gh-error-message errors=model.errors property="metaDescription"}}
|
2015-08-29 22:02:06 +03:00
|
|
|
|
{{/gh-form-group}}
|
2014-09-04 17:56:07 +04:00
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Search Engine Result Preview</label>
|
|
|
|
|
<div class="seo-preview">
|
2014-09-19 03:42:07 +04:00
|
|
|
|
<div class="seo-preview-title">{{seoTitle}}</div>
|
2014-10-17 20:18:52 +04:00
|
|
|
|
<div class="seo-preview-link">{{seoURL}}</div>
|
2014-09-19 03:42:07 +04:00
|
|
|
|
<div class="seo-preview-description">{{seoDescription}}</div>
|
2014-09-04 17:56:07 +04:00
|
|
|
|
</div>
|
2014-12-02 01:45:45 +03:00
|
|
|
|
</div>
|
2014-09-21 22:56:30 +04:00
|
|
|
|
</form>
|
2014-10-13 19:23:06 +04:00
|
|
|
|
</div>{{! .settings-menu-content }}
|
2015-03-16 20:55:56 +03:00
|
|
|
|
{{/if}}
|
2014-09-19 03:42:07 +04:00
|
|
|
|
{{/gh-tab-pane}}
|
|
|
|
|
</div>
|
2014-09-15 04:40:24 +04:00
|
|
|
|
</div>
|
2014-09-19 03:42:07 +04:00
|
|
|
|
{{/gh-tabs-manager}}
|