From 6bfd0240467c3507060e9ba9f8936aaba19dc9e4 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 17 Sep 2013 11:39:27 +0100 Subject: [PATCH] Post settings menu tweaks closes #782, #783 - delete button hidden until ID - publish date works before publish --- ghost/admin/tpl/preview.hbs | 8 ++++---- ghost/admin/views/post-settings.js | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ghost/admin/tpl/preview.hbs b/ghost/admin/tpl/preview.hbs index df332f7092..9fd8427b93 100644 --- a/ghost/admin/tpl/preview.hbs +++ b/ghost/admin/tpl/preview.hbs @@ -8,8 +8,8 @@ {{#if author.name}}{{author.name}}{{else}}{{author.email}}{{/if}}
- -
diff --git a/ghost/admin/views/post-settings.js b/ghost/admin/views/post-settings.js index 0e77418b50..53e090f0cd 100644 --- a/ghost/admin/views/post-settings.js +++ b/ghost/admin/views/post-settings.js @@ -16,6 +16,7 @@ initialize: function () { if (this.model) { + this.listenTo(this.model, 'change:id', this.render); this.listenTo(this.model, 'change:status', this.render); this.listenTo(this.model, 'change:published_at', this.render); } @@ -24,14 +25,17 @@ render: function () { var slug = this.model ? this.model.get('slug') : '', pubDate = this.model ? this.model.get('published_at') : 'Not Published', - $pubDateEl = $('.post-setting-date'); + $pubDateEl = this.$('.post-setting-date'); $('.post-setting-slug').val(slug); // Insert the published date, and make it editable if it exists. if (this.model && this.model.get('published_at')) { pubDate = moment(pubDate).format('DD MMM YY'); - $pubDateEl.removeAttr('disabled'); + } + + if (this.model && this.model.get('id')) { + this.$('.delete').removeClass('hidden'); } $pubDateEl.val(pubDate);