0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fix error when uploading logo/cover image

closes #1616
- removed pars from model
- changed checkbox handling
This commit is contained in:
Sebastian Gierlinger 2013-12-06 16:43:53 +01:00
parent ed9d216ae7
commit 8a83e9ea4e
3 changed files with 4 additions and 7 deletions

View file

@ -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'
});
}());

View file

@ -56,7 +56,7 @@
<div class="form-group">
<label for="permalinks">Dated Permalinks</label>
<input id="permalinks" name="general[permalinks]" type="checkbox" value="1" {{#if permalinks}}checked{{/if}}>
<input id="permalinks" name="general[permalinks]" type="checkbox" value='permalink'/>
<label class="checkbox" for="permalinks"></label>
<p>Include date in your post's links</p>
</div>

View file

@ -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);
}