mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Merge pull request #2946 from halfdan/fix-page
Fixes static pages when permalinks are active.
This commit is contained in:
commit
fd8cc542b5
3 changed files with 6 additions and 6 deletions
|
@ -7,16 +7,16 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (arguments.length > 1) {
|
if (arguments.length > 1) {
|
||||||
this.set('page', val ? 1 : 0);
|
this.set('page', val);
|
||||||
|
|
||||||
return this.get('model').save().then(function () {
|
return this.get('model').save().then(function () {
|
||||||
self.notifications.showSuccess('Successfully converted to ' + (val ? 'static page' : 'post'));
|
self.notifications.showSuccess('Successfully converted to ' + (val ? 'static page' : 'post'));
|
||||||
|
|
||||||
return !!self.get('page');
|
return self.get('page');
|
||||||
}, this.notifications.showErrors);
|
}, this.notifications.showErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!this.get('page');
|
return this.get('page');
|
||||||
}.property('page'),
|
}.property('page'),
|
||||||
/**
|
/**
|
||||||
* The placeholder is the published date of the post,
|
* The placeholder is the published date of the post,
|
||||||
|
@ -157,4 +157,4 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PostSettingsMenuController;
|
export default PostSettingsMenuController;
|
||||||
|
|
|
@ -65,7 +65,7 @@ function urlPathForPost(post, permalinks) {
|
||||||
id: function () { return post.id; }
|
id: function () { return post.id; }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (post.page === 1) {
|
if (post.page) {
|
||||||
output += '/:slug/';
|
output += '/:slug/';
|
||||||
} else {
|
} else {
|
||||||
output += permalinks.value;
|
output += permalinks.value;
|
||||||
|
|
|
@ -240,7 +240,7 @@ frontendControllers = {
|
||||||
// then the post must be a static post.
|
// then the post must be a static post.
|
||||||
// If it is not then we must return.
|
// If it is not then we must return.
|
||||||
if (usingStaticPermalink) {
|
if (usingStaticPermalink) {
|
||||||
if (post.page === 1) {
|
if (post.page) {
|
||||||
return render();
|
return render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue