PostSettingsMenu: Don't save new posts, reset values on failure

Closes #3158, Closes #3143, Closes #3134
- Added `togglePage` action to indirect the setting of `page`. togglePage resets page back to its original value in the case of an error saving.
- Removed `isStaticPage` property in favor of `togglePage` action
- `updateSlug` and `updatePublishedAt` similarly reset their respective properties on failure
- moved `updateSlug` error catching to outer promise (slugGenerator promise)
-  modifying the `page` and `published_at` properties will no longer cause a new post to save
- Close passive notifications on published date parse fail
- Removed promise creation in catch statements
Man, it would sure be swell if showErrors and showSuccess could take an
options param that specified that other passives should be closed. Wouldn't
it?
Thanks for the heads up


On Tue, Jul 1, 2014 at 10:00 PM, Jason Williams <notifications@github.com>
wrote:

> In core/client/controllers/post-settings-menu.js:
>
> > +            var value = this.toggleProperty('page'),
> > +                self = this;
> > +
> > +            // If this is a new post.  Don't save the model.  Defer the save
> > +            // to the user pressing the save button
> > +            if (this.get('isNew')) {
> > +                return;
> > +            }
> > +
> > +            return this.get('model').save().then(function () {
> > +                self.notifications.showSuccess('Successfully converted to ' + (value ? 'static page' : 'post'));
> > +                return value;
> > +            }).catch(function (errors) {
> > +                self.set('page', !value);
> > +                self.notifications.showErrors(errors);
> > +            });
>
> Just a heads-up that togglePage should be clearing notifications and is
> going to need a this.notifications.closePassive() in the .then and .catch
> handlers of the .save.
>
> See #3181 <https://github.com/TryGhost/Ghost/pull/3181>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/TryGhost/Ghost/pull/3180/files#r14440004>.
>