From 5f5993819a22c2d87b0292c620b9d9d2a5e0300c Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 23 Sep 2014 08:47:35 +0000 Subject: [PATCH] Static page and feature options in new PSM closes #4109 - Add featured option - Move static page/featured to other place - Change wording on static page --- ghost/admin/assets/sass/layouts/editor.scss | 26 ++++------ ghost/admin/controllers/post-settings-menu.js | 16 +++++++ ghost/admin/templates/-publish-bar.hbs | 5 +- ghost/admin/templates/editor-save-button.hbs | 4 ++ ghost/admin/templates/post-settings-menu.hbs | 47 +++++++------------ 5 files changed, 47 insertions(+), 51 deletions(-) diff --git a/ghost/admin/assets/sass/layouts/editor.scss b/ghost/admin/assets/sass/layouts/editor.scss index 401dfe5cdf..7ae465ca50 100644 --- a/ghost/admin/assets/sass/layouts/editor.scss +++ b/ghost/admin/assets/sass/layouts/editor.scss @@ -559,22 +559,6 @@ body.zen { } -#entry-controls { - &.unsaved { - .post-settings-menu { - padding-bottom: 0; - - .post-setting:nth-child(3) td { - border-bottom: none; - } - - .delete { - display: none; - } - } - } -} - #entry-actions { margin-right: 6px; position: relative; @@ -589,6 +573,14 @@ body.zen { bottom: 100%; } } + + &.unsaved { + padding-bottom: 0; + + .delete { + display: none; + } + } } #entry-actions-menu { @@ -750,4 +742,4 @@ body.zen { th { text-align: left; } -} \ No newline at end of file +} diff --git a/ghost/admin/controllers/post-settings-menu.js b/ghost/admin/controllers/post-settings-menu.js index 133d927a6c..4d2763a002 100644 --- a/ghost/admin/controllers/post-settings-menu.js +++ b/ghost/admin/controllers/post-settings-menu.js @@ -197,6 +197,22 @@ var PostSettingsMenuController = Ember.ObjectController.extend({ self.get('model').rollback(); }); }, + + toggleFeatured: function () { + var self = this; + + this.toggleProperty('featured'); + // 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; + } + + this.get('model').save(this.get('saveOptions')).catch(function (errors) { + self.showErrors(errors); + self.get('model').rollback(); + }); + }, /** * triggered by user manually changing slug */ diff --git a/ghost/admin/templates/-publish-bar.hbs b/ghost/admin/templates/-publish-bar.hbs index f8af05a32f..ca8fbe605c 100644 --- a/ghost/admin/templates/-publish-bar.hbs +++ b/ghost/admin/templates/-publish-bar.hbs @@ -1,13 +1,10 @@ diff --git a/ghost/admin/templates/editor-save-button.hbs b/ghost/admin/templates/editor-save-button.hbs index 0f0c61ecb7..0726fe178c 100644 --- a/ghost/admin/templates/editor-save-button.hbs +++ b/ghost/admin/templates/editor-save-button.hbs @@ -11,5 +11,9 @@
  • {{view.draftText}}
  • +
  • +
  • + Delete Post +
  • {{/gh-popover}} \ No newline at end of file diff --git a/ghost/admin/templates/post-settings-menu.hbs b/ghost/admin/templates/post-settings-menu.hbs index 3877bd9351..018ae3042c 100644 --- a/ghost/admin/templates/post-settings-menu.hbs +++ b/ghost/admin/templates/post-settings-menu.hbs @@ -1,6 +1,6 @@
    -{{#gh-tabs-manager selected="showSubview" id="entry-controls" classNameBindings="isNew:unsaved :right-outlet"}} -
    +{{#gh-tabs-manager selected="showSubview" id="entry-controls" class="right-outlet"}} +

    Post Settings

    @@ -37,13 +37,6 @@
    -
    - -
    - + +
    + + + +
    +