2015-12-14 15:52:53 +03:00
|
|
|
<section class="gh-view">
|
2016-10-24 13:55:55 +03:00
|
|
|
|
|
|
|
<header class="gh-editor-header">
|
|
|
|
<div class="gh-editor-status">
|
|
|
|
{{#if model.isPublished}}
|
|
|
|
Published
|
|
|
|
{{else if model.isScheduled}}
|
|
|
|
Scheduled
|
|
|
|
{{else}}
|
|
|
|
Draft
|
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}}
|
2016-10-24 13:55:55 +03:00
|
|
|
|
|
|
|
</div>
|
2015-06-13 17:34:09 +03:00
|
|
|
<section class="view-actions">
|
|
|
|
{{gh-editor-save-button
|
|
|
|
isPublished=model.isPublished
|
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
|
|
|
isScheduled=model.isScheduled
|
2015-06-13 17:34:09 +03:00
|
|
|
willPublish=willPublish
|
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
|
|
|
willSchedule=willSchedule
|
|
|
|
statusFreeze=statusFreeze
|
|
|
|
scheduledWillPublish=scheduledWillPublish
|
|
|
|
timeScheduled=model.timeScheduled
|
2015-06-13 17:34:09 +03:00
|
|
|
postOrPage=postOrPage
|
|
|
|
isNew=model.isNew
|
|
|
|
save="save"
|
|
|
|
setSaveType="setSaveType"
|
2015-11-18 13:50:48 +03:00
|
|
|
delete="toggleDeletePostModal"
|
2015-08-10 18:43:49 +03:00
|
|
|
submitting=submitting
|
2015-06-13 17:34:09 +03:00
|
|
|
}}
|
2017-02-27 13:02:10 +03:00
|
|
|
<button type="button" class="post-settings" title="Settings" {{action "openSettingsMenu"}}>
|
2017-04-07 18:23:45 +03:00
|
|
|
{{inline-svg "settings"}}
|
2017-02-27 13:02:10 +03:00
|
|
|
</button>
|
2015-06-13 17:34:09 +03:00
|
|
|
</section>
|
|
|
|
</header>
|
2016-10-24 13:55:55 +03:00
|
|
|
<div class="gh-editor-container">
|
|
|
|
<div class="gh-editor-inner">
|
2017-04-07 18:23:45 +03:00
|
|
|
{{gh-editor-title
|
2017-03-22 02:42:14 +03:00
|
|
|
val=(readonly model.titleScratch)
|
2017-04-07 18:23:45 +03:00
|
|
|
onChange=(action (mut model.titleScratch))
|
|
|
|
tabindex="1"
|
|
|
|
shouldFocus=shouldFocusTitle
|
|
|
|
focus-out="updateTitle"
|
|
|
|
update=(action (perform updateTitle))
|
2017-04-07 23:05:43 +03:00
|
|
|
id="gh-editor-title"
|
|
|
|
koenigEditor=(readonly editor)
|
2017-03-22 02:42:14 +03:00
|
|
|
}}
|
2016-10-24 13:55:55 +03:00
|
|
|
{{#if scheduleCountdown}}
|
|
|
|
<time datetime="{{post.publishedAtUTC}}" class="gh-notification gh-notification-schedule">
|
|
|
|
Post will be published {{scheduleCountdown}}.
|
|
|
|
</time>
|
|
|
|
{{/if}}
|
2017-03-01 21:50:08 +03:00
|
|
|
{{gh-koenig
|
2016-10-24 13:55:55 +03:00
|
|
|
value=(readonly model.scratch)
|
|
|
|
onChange=(action (mut model.scratch))
|
|
|
|
onFirstChange=(action "autoSaveNew")
|
|
|
|
onTeardown=(action "cancelTimers")
|
|
|
|
shouldFocusEditor=shouldFocusEditor
|
|
|
|
apiRoot=apiRoot
|
|
|
|
assetPath=assetPath
|
2017-04-07 23:05:43 +03:00
|
|
|
tabindex="2"
|
|
|
|
containerSelector=".gh-editor-container"
|
|
|
|
setEditor=(action "setEditor")
|
2016-10-24 13:55:55 +03:00
|
|
|
}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-14 15:52:53 +03:00
|
|
|
</section>
|
2015-11-18 13:50:48 +03:00
|
|
|
|
|
|
|
{{#if showDeletePostModal}}
|
|
|
|
{{gh-fullscreen-modal "delete-post"
|
2017-03-02 11:49:10 +03:00
|
|
|
model=(hash post=model onSuccess=(route-action 'redirectToContentScreen'))
|
|
|
|
close=(action "toggleDeletePostModal")
|
|
|
|
modifier="action wide"}}
|
2015-11-18 13:50:48 +03:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if showLeaveEditorModal}}
|
|
|
|
{{gh-fullscreen-modal "leave-editor"
|
2017-03-02 11:49:10 +03:00
|
|
|
confirm=(action "leaveEditor")
|
|
|
|
close=(action "toggleLeaveEditorModal")
|
|
|
|
modifier="action wide"}}
|
2015-11-18 13:50:48 +03:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if showReAuthenticateModal}}
|
|
|
|
{{gh-fullscreen-modal "re-authenticate"
|
2017-03-02 11:49:10 +03:00
|
|
|
close=(action "toggleReAuthenticateModal")
|
|
|
|
modifier="action wide"}}
|
2015-11-18 13:50:48 +03:00
|
|
|
{{/if}}
|
2017-03-10 17:30:01 +03:00
|
|
|
|
|
|
|
{{#liquid-wormhole}}
|
|
|
|
{{gh-post-settings-menu
|
|
|
|
model=model
|
|
|
|
showSettingsMenu=application.showSettingsMenu
|
|
|
|
closeNavMenu=(action "closeNavMenu")
|
|
|
|
closeMenus=(action "closeMenus")
|
|
|
|
}}
|
|
|
|
{{/liquid-wormhole}}
|