From 8a83e9ea4e7b5872ff52d2a7b4ca1248041b5273 Mon Sep 17 00:00:00 2001 From: Sebastian Gierlinger Date: Fri, 6 Dec 2013 16:43:53 +0100 Subject: [PATCH] Fix error when uploading logo/cover image closes #1616 - removed pars from model - changed checkbox handling --- core/client/models/settings.js | 6 +----- core/client/tpl/settings/general.hbs | 2 +- core/client/views/settings.js | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/client/models/settings.js b/core/client/models/settings.js index 2048fbee51..b57193f35c 100644 --- a/core/client/models/settings.js +++ b/core/client/models/settings.js @@ -4,11 +4,7 @@ //id:0 is used to issue PUT requests Ghost.Models.Settings = Ghost.ProgressModel.extend({ url: Ghost.paths.apiRoot + '/settings/?type=blog,theme', - id: '0', - parse: function (resp) { - resp.permalinks = resp.permalinks === "/:slug/" ? "" : "1"; - return resp; - } + id: '0' }); }()); diff --git a/core/client/tpl/settings/general.hbs b/core/client/tpl/settings/general.hbs index f90b762a49..765957cc0b 100644 --- a/core/client/tpl/settings/general.hbs +++ b/core/client/tpl/settings/general.hbs @@ -56,7 +56,7 @@
- +

Include date in your post's links

diff --git a/core/client/views/settings.js b/core/client/views/settings.js index f7653d93cc..9f998852ec 100644 --- a/core/client/views/settings.js +++ b/core/client/views/settings.js @@ -158,7 +158,7 @@ description = this.$('#blog-description').val(), email = this.$('#email-address').val(), postsPerPage = this.$('#postsPerPage').val(), - permalinks = this.$('#permalinks').is(':checked') ? "/:year/:month/:day/:slug/" : "/:slug/"; + permalinks = this.$('#permalinks').is(':checked') ? '/:year/:month/:day/:slug/' : '/:slug/'; Ghost.Validate._errors = []; Ghost.Validate @@ -235,6 +235,7 @@ templateName: 'settings/general', afterRender: function () { + this.$('#permalinks').prop('checked', this.model.get('permalinks') === '/:slug/' ? false : true); this.$('.js-drop-zone').upload(); Settings.Pane.prototype.afterRender.call(this); }