Fixes static pages when permalinks are active.

fixes #2938
- Fix `page === 1` occurences
- Fix ember logic
This commit is contained in:
Fabian Becker 2014-06-12 11:44:10 +02:00
parent ef3c377d2c
commit 21a7e3ebb2
3 changed files with 5 additions and 5 deletions

View File

@ -5,16 +5,16 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
var self = this;
if (arguments.length > 1) {
this.set('page', val ? 1 : 0);
this.set('page', val);
return this.get('model').save().then(function () {
self.notifications.showSuccess('Successfully converted to ' + (val ? 'static page' : 'post'));
return !!self.get('page');
return self.get('page');
}, this.notifications.showErrors);
}
return !!this.get('page');
return this.get('page');
}.property('page'),
newSlugBinding: Ember.computed.oneWay('slug'),

View File

@ -65,7 +65,7 @@ function urlPathForPost(post, permalinks) {
id: function () { return post.id; }
};
if (post.page === 1) {
if (post.page) {
output += '/:slug/';
} else {
output += permalinks.value;

View File

@ -240,7 +240,7 @@ frontendControllers = {
// then the post must be a static post.
// If it is not then we must return.
if (usingStaticPermalink) {
if (post.page === 1) {
if (post.page) {
return render();
}