From b6d1390f71bcb7ba4a11e344e779cf5b73bd0eda Mon Sep 17 00:00:00 2001 From: Sebastian Gierlinger Date: Sun, 8 Sep 2013 22:11:52 +0200 Subject: [PATCH] Clean up settings/general screen Closes #345 - added blog description to general screen - removed content screen from sidebar - removed beforeRender from settings front end - removed content screen from tests --- ghost/admin/models/settings.js | 9 +---- ghost/admin/tpl/settings/content.hbs | 5 --- ghost/admin/tpl/settings/general.hbs | 50 +++++++--------------------- ghost/admin/tpl/settings/sidebar.hbs | 1 - ghost/admin/views/settings.js | 32 ++++-------------- 5 files changed, 19 insertions(+), 78 deletions(-) diff --git a/ghost/admin/models/settings.js b/ghost/admin/models/settings.js index 31f1c7000a..66c63a7c71 100644 --- a/ghost/admin/models/settings.js +++ b/ghost/admin/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/ghost/admin/tpl/settings/content.hbs b/ghost/admin/tpl/settings/content.hbs index ee6b163809..83617b4948 100644 --- a/ghost/admin/tpl/settings/content.hbs +++ b/ghost/admin/tpl/settings/content.hbs @@ -58,11 +58,6 @@ -
- - -
- diff --git a/ghost/admin/tpl/settings/general.hbs b/ghost/admin/tpl/settings/general.hbs index 9d95b01561..0d3060c08a 100644 --- a/ghost/admin/tpl/settings/general.hbs +++ b/ghost/admin/tpl/settings/general.hbs @@ -13,44 +13,32 @@

How your blog name appears on the site

+
+ + +

Display a short description below the blog title

+
+
{{#if logo}} - + {{else}} {{/if}}

Display a logo on your site in place of blog title

-
- - {{#if icon}} - icon - {{else}} - Upload Image - {{/if}} - -

The icon for your blog, used in your browser tab and elsewhere

-
-

Address to use for admin notifications

-
- +
- - + + +

Number of posts per page displayed

@@ -60,24 +48,10 @@ {{/each}} -
-
- - -

Number of posts per page displayed

+

Select a theme for your blog

-
- -
-
- - -
-
\ No newline at end of file diff --git a/ghost/admin/tpl/settings/sidebar.hbs b/ghost/admin/tpl/settings/sidebar.hbs index 2dd95bb005..246d0882c5 100644 --- a/ghost/admin/tpl/settings/sidebar.hbs +++ b/ghost/admin/tpl/settings/sidebar.hbs @@ -4,7 +4,6 @@ \ No newline at end of file diff --git a/ghost/admin/views/settings.js b/ghost/admin/views/settings.js index 9b6ec81ed0..4daa24ed19 100644 --- a/ghost/admin/views/settings.js +++ b/ghost/admin/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 @@ -226,12 +227,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); @@ -256,12 +251,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 @@ -340,17 +331,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) {