diff --git a/core/client/models/settings.js b/core/client/models/settings.js
index 31f1c7000a..66c63a7c71 100644
--- a/core/client/models/settings.js
+++ b/core/client/models/settings.js
@@ -2,15 +2,8 @@
(function () {
"use strict";
- // Set the url manually and id to '0' to force PUT requests
Ghost.Models.Settings = Backbone.Model.extend({
- url: Ghost.settings.apiRoot + '/settings',
- id: "0",
- defaults: {
- title: 'My Blog',
- description: '',
- email: 'admin@tryghost.org'
- }
+ url: Ghost.settings.apiRoot + '/settings'
});
}());
\ No newline at end of file
diff --git a/core/client/tpl/settings/content.hbs b/core/client/tpl/settings/content.hbs
index ee6b163809..83617b4948 100644
--- a/core/client/tpl/settings/content.hbs
+++ b/core/client/tpl/settings/content.hbs
@@ -58,11 +58,6 @@
-
-
-
-
-
diff --git a/core/client/tpl/settings/general.hbs b/core/client/tpl/settings/general.hbs
index 9d95b01561..0d3060c08a 100644
--- a/core/client/tpl/settings/general.hbs
+++ b/core/client/tpl/settings/general.hbs
@@ -13,44 +13,32 @@
How your blog name appears on the site
+
+
-
-
-
+
@@ -60,24 +48,10 @@
{{/each}}
-
-
-
-
-
\ No newline at end of file
diff --git a/core/client/tpl/settings/sidebar.hbs b/core/client/tpl/settings/sidebar.hbs
index 2dd95bb005..246d0882c5 100644
--- a/core/client/tpl/settings/sidebar.hbs
+++ b/core/client/tpl/settings/sidebar.hbs
@@ -4,7 +4,6 @@
\ No newline at end of file
diff --git a/core/client/views/settings.js b/core/client/views/settings.js
index e23b9bb6fe..312320ec9e 100644
--- a/core/client/views/settings.js
+++ b/core/client/views/settings.js
@@ -160,12 +160,13 @@
var themes = this.model.get('availableThemes');
this.model.unset('availableThemes');
this.model.save({
+ id: 0, //workaround to use put
title: this.$('#blog-title').val(),
+ description: $('#blog-description').val(),
+ logo: this.$('#blog-logo').attr("src"),
email: this.$('#email-address').val(),
- logo: this.$('#logo').attr("src"),
- icon: this.$('#icon').attr("src"),
- activeTheme: this.$('#activeTheme').val(),
- postsPerPage: this.$('#postsPerPage').val()
+ postsPerPage: this.$('#postsPerPage').val(),
+ activeTheme: this.$('#activeTheme').val()
}, {
success: this.saveSuccess,
error: this.saveError
@@ -202,12 +203,6 @@
},
templateName: 'settings/general',
- beforeRender: function () {
- var settings = this.model.toJSON();
- this.$('#blog-title').val(settings.title);
- this.$('#email-address').val(settings.email);
- },
-
afterRender: function () {
this.$('.js-drop-zone').upload();
Settings.Pane.prototype.afterRender.call(this);
@@ -232,12 +227,8 @@
this.model.set({availableThemes: themes});
},
- templateName: 'settings/content',
+ templateName: 'settings/content'
- beforeRender: function () {
- var settings = this.model.toJSON();
- this.$('#blog-description').val(settings.description);
- }
});
// ### User profile
@@ -347,17 +338,6 @@
templateName: 'settings/user-profile',
- beforeRender: function () {
- var user = this.model.toJSON();
- this.$('#user-name').val(user.full_name);
- this.$('#user-email').val(user.email_address);
- this.$('#user-location').val(user.location);
- this.$('#user-website').val(user.url);
- this.$('#user-bio').val(user.bio);
- this.$('#user-profile-picture').attr('src', user.profile_picture);
- this.$('#user-cover-picture').attr('src', user.cover_picture);
- },
-
afterRender: function () {
var self = this;
Countable.live(document.getElementById('user-bio'), function (counter) {
diff --git a/core/test/functional/admin/05_settings_test.js b/core/test/functional/admin/05_settings_test.js
index 40a6237035..ae0223830b 100644
--- a/core/test/functional/admin/05_settings_test.js
+++ b/core/test/functional/admin/05_settings_test.js
@@ -1,6 +1,6 @@
/*globals casper, __utils__, url */
-casper.test.begin("Settings screen is correct", 19, function suite(test) {
+casper.test.begin("Settings screen is correct", 15, function suite(test) {
test.filename = "settings_test.png";
casper.start(url + "ghost/settings", function testTitleAndUrl() {
@@ -22,31 +22,12 @@ casper.test.begin("Settings screen is correct", 19, function suite(test) {
}, "loaded content is general screen");
});
- // test the publishing / content tab
- casper.thenClick('.settings-menu .publishing');
- casper.waitForSelector('#content', function then() {
- test.assertEval(function testGeneralIsNotActive() {
- return !document.querySelector('.settings-menu .general').classList.contains('active');
- }, "general tab is not marked active");
- test.assertEval(function testContentIsActive() {
- return document.querySelector('.settings-menu .publishing').classList.contains('active');
- }, "content tab is marked active");
- test.assertEval(function testContentIsContent() {
- return document.querySelector('.settings-content').id === 'content';
- }, "loaded content is content screen");
- }, function onTimeOut() {
- test.fail('Content screen failed to load');
- });
-
// test the user tab
casper.thenClick('.settings-menu .users');
casper.waitForSelector('#user', function then() {
test.assertEval(function testGeneralIsNotActive() {
return !document.querySelector('.settings-menu .general').classList.contains('active');
}, "general tab is not marked active");
- test.assertEval(function testContentIsNotActive() {
- return !document.querySelector('.settings-menu .publishing').classList.contains('active');
- }, "content tab is marked active");
test.assertEval(function testUserIsActive() {
return document.querySelector('.settings-menu .users').classList.contains('active');
}, "user tab is marked active");