0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Update placeholder of published data in editor

fixes #1351

- when a post has a published_at value show a blank
placeholder

- when a post doesn’t have a published_at
value then show the required published at value
format
This commit is contained in:
Harry Wolff 2014-01-07 23:13:16 -05:00
parent 3c1a7e03b5
commit 1c8b96fea3

View file

@ -29,7 +29,8 @@
var slug = this.model ? this.model.get('slug') : '', var slug = this.model ? this.model.get('slug') : '',
pubDate = this.model ? this.model.get('published_at') : 'Not Published', pubDate = this.model ? this.model.get('published_at') : 'Not Published',
$pubDateEl = this.$('.post-setting-date'), $pubDateEl = this.$('.post-setting-date'),
$postSettingSlugEl = this.$('.post-setting-slug'); $postSettingSlugEl = this.$('.post-setting-slug'),
publishedDateFormat = 'DD MMM YY HH:mm';
$postSettingSlugEl.val(slug); $postSettingSlugEl.val(slug);
@ -40,7 +41,10 @@
// Insert the published date, and make it editable if it exists. // Insert the published date, and make it editable if it exists.
if (this.model && this.model.get('published_at')) { if (this.model && this.model.get('published_at')) {
pubDate = moment(pubDate).format('DD MMM YY HH:mm'); pubDate = moment(pubDate).format(publishedDateFormat);
$pubDateEl.attr('placeholder', '');
} else {
$pubDateEl.attr('placeholder', moment().format(publishedDateFormat));
} }
if (this.model && this.model.get('id')) { if (this.model && this.model.get('id')) {