Merge pull request #672 from ErisDS/blog-cover

Added blog cover image
This commit is contained in:
Hannah Wolfe 2013-09-09 10:24:26 -07:00
commit 6fd3926156
5 changed files with 18 additions and 92 deletions

@ -1 +1 @@
Subproject commit 19ed4267fe3bd086f462eda610243fcca9b41863
Subproject commit 9aaa0ec17a59c09093857fd107262a239bb65c17

View File

@ -1,64 +0,0 @@
<header>
<h2 class="title">Content</h2>
<section class="page-actions">
<button class="button-save">Save</button>
</section>
</header>
<section class="content">
<form id="settings-content">
<fieldset>
<div class="form-group">
<label for="typography"><strong>Typography</strong></label>
<select id="typography" name="content[typography]">
<option value="post-name">Lato (Light)</option>
</select>
<p>Sexy sans-serif font that will make your toes tickle.</p>
<label class="checkbox">
<input type="checkbox" value="1" name="content[type-load-google]"/> Load fonts directly from Google
</label>
</div>
<div class="form-group">
<label><strong>Post Options</strong></label>
<label class="checkbox">
<input type="checkbox" name="content[display-post-meta]" value="1" /> Display Post Meta
</label>
<p>Post Author / Date / Views</p>
<label class="checkbox">
<input type="checkbox" name="content[show-author]" value="1" /> Show Author Box After Post
</label>
<label class="checkbox">
<input type="checkbox" name="content[comments]" value="1" /> Enable Comments
</label>
</div>
</fieldset>
<hr />
<fieldset>
<div class="form-group">
<label for="seo-title"><strong>SEO Title Pattern</strong></label>
<input id="seo-title" name="content[seo-title]" type="text" value="[Post Name] - [Site Title]" />
<p>The pattern used to display your title tags</p>
</div>
<div class="form-group">
<label for="seo-description"><strong>SEO Description Pattern</strong></label>
<input id="seo-description" name="content[seo-description]" type="text" value="Auto" />
<p>The pattern used to display your meta descriptions</p>
</div>
<div class="form-group">
<label><strong>Google+</strong></label>
<label class="checkbox">
<input type="checkbox" name="content[google-profile]" value="1" /> Connect to author profile on Google
</label>
</div>
</fieldset>
</form>
</section>

View File

@ -29,12 +29,22 @@
<p>Display a logo on your site in place of blog title</p>
</div>
<div class="form-group">
<label><strong>Blog Cover</strong></label>
{{#if logo}}
<a class="js-modal-cover"><img id="blog-cover" src="{{cover}}" alt="cover photo"></a>
{{else}}
<a class="button-add js-modal-cover" href="#">Upload Image</a>
{{/if}}
<p>Display a cover photo on your site</p>
</div>
<div class="form-group">
<label for="email-address"><strong>Email Address</strong></label>
<input id="email-address" name="general[email-address]" type="email" value="{{email}}">
<p>Address to use for <a href="#">admin notifications</a></p>
</div>
<div class="form-group">
<label for="postsPerPage"><strong>Posts per page</strong></label>
<input id="postsPerPage" name="general[postsPerPage]" type="number" value="{{postsPerPage}}">

View File

@ -153,7 +153,7 @@
events: {
'click .button-save': 'saveSettings',
'click .js-modal-logo': 'showLogo',
'click .js-modal-icon': 'showIcon'
'click .js-modal-cover': 'showCover'
},
saveSettings: function () {
@ -164,6 +164,7 @@
title: this.$('#blog-title').val(),
description: $('#blog-description').val(),
logo: this.$('#blog-logo').attr("src"),
cover: this.$('#blog-cover').attr("src"),
email: this.$('#email-address').val(),
postsPerPage: this.$('#postsPerPage').val(),
activeTheme: this.$('#activeTheme').val()
@ -177,9 +178,9 @@
var settings = this.model.toJSON();
this.showUpload('#logo', 'logo', settings.logo);
},
showIcon: function () {
showCover: function () {
var settings = this.model.toJSON();
this.showUpload('#icon', 'icon', settings.icon);
this.showUpload('#cover', 'cover', settings.icon);
},
showUpload: function (id, key, src) {
var self = this, upload = new Ghost.Models.uploadModal({'id': id, 'key': key, 'src': src, 'accept': {
@ -209,28 +210,6 @@
}
});
// ### Content settings
Settings.content = Settings.Pane.extend({
id: 'content',
events: {
'click .button-save': 'saveSettings'
},
saveSettings: function () {
var themes = this.model.get('availableThemes');
this.model.unset('availableThemes');
this.model.save({
description: this.$('#blog-description').val()
}, {
success: this.saveSuccess,
error: this.saveError
});
this.model.set({availableThemes: themes});
},
templateName: 'settings/content'
});
// ### User profile
Settings.user = Settings.Pane.extend({
id: 'user',

View File

@ -105,7 +105,8 @@ Ghost = function () {
url: instance.config().env[process.env.NODE_ENV].url,
title: instance.settings().title,
description: instance.settings().description,
logo: instance.settings().logo
logo: instance.settings().logo,
cover: instance.settings().cover
};
},
statuses: function () { return statuses; },