diff --git a/app/components/gh-post-settings-menu.js b/app/components/gh-post-settings-menu.js index e5e567bbd0..99a3dfdb47 100644 --- a/app/components/gh-post-settings-menu.js +++ b/app/components/gh-post-settings-menu.js @@ -300,7 +300,7 @@ export default Component.extend(SettingsMenuMixin, { }, setCoverImage(image) { - this.set('model.image', image); + this.set('model.featureImage', image); if (this.get('model.isNew')) { return; @@ -313,7 +313,7 @@ export default Component.extend(SettingsMenuMixin, { }, clearCoverImage() { - this.set('model.image', ''); + this.set('model.featureImage', ''); if (this.get('model.isNew')) { return; diff --git a/app/components/gh-posts-list-item.js b/app/components/gh-posts-list-item.js index 295d20bc2e..e893ba28d0 100644 --- a/app/components/gh-posts-list-item.js +++ b/app/components/gh-posts-list-item.js @@ -28,8 +28,8 @@ export default Component.extend({ return this.get('post.author.name') || this.get('post.author.email'); }), - authorAvatar: computed('post.author.image', function () { - return this.get('post.author.image') || `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; + authorAvatar: computed('post.author.profileImage', function () { + return this.get('post.author.profileImage') || `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; }), authorAvatarBackground: computed('authorAvatar', function () { diff --git a/app/components/gh-tag-settings-form.js b/app/components/gh-tag-settings-form.js index f708393277..65269eb427 100644 --- a/app/components/gh-tag-settings-form.js +++ b/app/components/gh-tag-settings-form.js @@ -119,11 +119,11 @@ export default Component.extend({ }, setCoverImage(image) { - this.send('setProperty', 'image', image); + this.send('setProperty', 'featureImage', image); }, clearCoverImage() { - this.send('setProperty', 'image', ''); + this.send('setProperty', 'featureImage', ''); }, openMeta() { diff --git a/app/controllers/setup/two.js b/app/controllers/setup/two.js index 89c023dfa2..3c0d4c2498 100644 --- a/app/controllers/setup/two.js +++ b/app/controllers/setup/two.js @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ import Controller from 'ember-controller'; import RSVP from 'rsvp'; import ValidationEngine from 'ghost-admin/mixins/validation-engine'; @@ -26,7 +27,7 @@ export default Controller.extend(ValidationEngine, { blogTitle: null, email: '', flowErrors: '', - image: null, + profileImage: null, name: null, password: null, @@ -94,14 +95,14 @@ export default Controller.extend(ValidationEngine, { * @return {Ember.RSVP.Promise} A promise that takes care of both calls */ _sendImage(user) { - let image = this.get('image'); + let image = this.get('profileImage'); return new Promise((resolve, reject) => { image.formData = {}; return image.submit() .done((response) => { let usersUrl = this.get('ghostPaths.url').api('users', user.id.toString()); - user.image = response; + user.profile_image = response; return this.get('ajax').put(usersUrl, { data: { @@ -215,7 +216,7 @@ export default Controller.extend(ValidationEngine, { }, _afterAuthentication(result) { - if (this.get('image')) { + if (this.get('profileImage')) { return this._sendImage(result.users[0]) .then(() => { @@ -248,7 +249,7 @@ export default Controller.extend(ValidationEngine, { }, setImage(image) { - this.set('image', image); + this.set('profileImage', image); } } }); diff --git a/app/controllers/signup.js b/app/controllers/signup.js index e5d4a53b9d..bf16c13113 100644 --- a/app/controllers/signup.js +++ b/app/controllers/signup.js @@ -178,7 +178,7 @@ export default Controller.extend(ValidationEngine, { }, setImage(image) { - this.set('image', image); + this.set('profileImage', image); } } }); diff --git a/app/controllers/team/user.js b/app/controllers/team/user.js index 941dcf22a6..f422a7a96d 100644 --- a/app/controllers/team/user.js +++ b/app/controllers/team/user.js @@ -74,8 +74,8 @@ export default Controller.extend({ return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; }), - userImageBackground: computed('user.image', 'userDefault', function () { - let url = this.get('user.image') || this.get('userDefault'); + userImageBackground: computed('user.profileImage', 'userDefault', function () { + let url = this.get('user.profileImage') || this.get('userDefault'); let safeUrl = Handlebars.Utils.escapeExpression(url); return htmlSafe(`background-image: url(${safeUrl})`); @@ -86,8 +86,8 @@ export default Controller.extend({ return `${this.get('ghostPaths.assetRoot')}/img/user-cover.png`; }), - coverImageBackground: computed('user.cover', 'coverDefault', function () { - let url = this.get('user.cover') || this.get('coverDefault'); + coverImageBackground: computed('user.coverImage', 'coverDefault', function () { + let url = this.get('user.coverImage') || this.get('coverDefault'); let safeUrl = Handlebars.Utils.escapeExpression(url); return htmlSafe(`background-image: url(${safeUrl})`); diff --git a/app/models/post.js b/app/models/post.js index 9132cbc1f7..19e730f050 100644 --- a/app/models/post.js +++ b/app/models/post.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import Ember from 'ember'; import computed, {equal, filterBy} from 'ember-computed'; import injectService from 'ember-service/inject'; @@ -81,7 +80,7 @@ export default Model.extend(Comparable, ValidationEngine, { markdown: attr('string', {defaultValue: ''}), mobiledoc: attr('json-string', {defaultValue: () => BLANK_DOC}), html: attr('string'), - image: attr('string'), + featureImage: attr('string'), featured: attr('boolean', {defaultValue: false}), page: attr('boolean', {defaultValue: false}), status: attr('string', {defaultValue: 'draft'}), diff --git a/app/models/setting.js b/app/models/setting.js index d389e762b3..fcfefab40c 100644 --- a/app/models/setting.js +++ b/app/models/setting.js @@ -9,7 +9,7 @@ export default Model.extend(ValidationEngine, { title: attr('string'), description: attr('string'), logo: attr('string'), - cover: attr('string'), + cover_image: attr('string'), icon: attr('string'), defaultLang: attr('string'), forceI18n: attr('boolean'), diff --git a/app/models/tag.js b/app/models/tag.js index 1f98695196..78efb60e80 100644 --- a/app/models/tag.js +++ b/app/models/tag.js @@ -17,7 +17,7 @@ export default Model.extend(ValidationEngine, { parent: attr(), metaTitle: attr('string'), metaDescription: attr('string'), - image: attr('string'), + featureImage: attr('string'), visibility: attr('string', {defaultValue: 'public'}), createdAtUTC: attr('moment-utc'), updatedAtUTC: attr('moment-utc'), diff --git a/app/models/user.js b/app/models/user.js index 2755547d55..19cc87eb2b 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -14,8 +14,8 @@ export default Model.extend(ValidationEngine, { name: attr('string'), slug: attr('string'), email: attr('string'), - image: attr('string'), - cover: attr('string'), + profileImage: attr('string'), + coverImage: attr('string'), bio: attr('string'), website: attr('string'), location: attr('string'), diff --git a/app/templates/components/gh-post-settings-menu.hbs b/app/templates/components/gh-post-settings-menu.hbs index 151247ed1d..15c7bc1a98 100644 --- a/app/templates/components/gh-post-settings-menu.hbs +++ b/app/templates/components/gh-post-settings-menu.hbs @@ -9,7 +9,7 @@
{{gh-image-uploader-with-preview - image=model.image + image=model.featureImage text="Add post image" update=(action "setCoverImage") remove=(action "clearCoverImage") diff --git a/app/templates/components/gh-tag-settings-form.hbs b/app/templates/components/gh-tag-settings-form.hbs index 932e3d3c39..06b38d6f7c 100644 --- a/app/templates/components/gh-tag-settings-form.hbs +++ b/app/templates/components/gh-tag-settings-form.hbs @@ -10,7 +10,7 @@
{{gh-image-uploader-with-preview - image=tag.image + image=tag.featureImage text="Add tag image" update=(action "setCoverImage") remove=(action "clearCoverImage")}} diff --git a/app/templates/settings/general.hbs b/app/templates/settings/general.hbs index 6b4a2fe76c..a07dd4e1ac 100644 --- a/app/templates/settings/general.hbs +++ b/app/templates/settings/general.hbs @@ -98,15 +98,15 @@
An optional large background image for your site
- {{#if model.cover}} - cover photo + {{#if model.cover_image}} + cover photo {{else}} {{/if}} {{#if showUploadCoverModal}} {{gh-fullscreen-modal "upload-image" - model=(hash model=model imageProperty="cover") + model=(hash model=model imageProperty="cover_image") close=(action "toggleUploadCoverModal") modifier="action wide"}} {{/if}} diff --git a/app/templates/team/user.hbs b/app/templates/team/user.hbs index 0f210fcbcf..2b5b3f5284 100644 --- a/app/templates/team/user.hbs +++ b/app/templates/team/user.hbs @@ -90,7 +90,7 @@ {{#if showUploadCoverModal}} {{gh-fullscreen-modal "upload-image" - model=(hash model=user imageProperty="cover") + model=(hash model=user imageProperty="coverImage") close=(action "toggleUploadCoverModal") modifier="action wide"}} {{/if}} @@ -109,7 +109,7 @@ {{#if showUploadImageModal}} {{gh-fullscreen-modal "upload-image" - model=(hash model=user imageProperty="image") + model=(hash model=user imageProperty="profileImage") close=(action "toggleUploadImageModal") modifier="action wide"}} {{/if}} diff --git a/mirage/factories/post.js b/mirage/factories/post.js index 7bf9cd29a5..c7263b5249 100644 --- a/mirage/factories/post.js +++ b/mirage/factories/post.js @@ -7,7 +7,7 @@ export default Factory.extend({ slug(i) { return `post-${i}`; }, markdown(i) { return `Markdown for post ${i}.`; }, html(i) { return `

HTML for post ${i}.

`; }, - image(i) { return `/content/images/2015/10/post-${i}.jpg`; }, + featureImage(i) { return `/content/images/2015/10/post-${i}.jpg`; }, featured: false, page: false, status(i) { return faker.list.cycle('draft', 'published', 'scheduled')(i); }, diff --git a/mirage/factories/tag.js b/mirage/factories/tag.js index b360f4388b..66db206988 100644 --- a/mirage/factories/tag.js +++ b/mirage/factories/tag.js @@ -5,7 +5,7 @@ export default Factory.extend({ createdBy: 1, description(i) { return `Description for tag ${i}.`; }, visibility: 'public', - image(i) { return `/content/images/2015/10/tag-${i}.jpg`; }, + featureImage(i) { return `/content/images/2015/10/tag-${i}.jpg`; }, metaDescription(i) { return `Meta description for tag ${i}.`; }, metaTitle(i) { return `Meta Title for tag ${i}`; }, name(i) { return `Tag ${i}`; }, diff --git a/mirage/factories/user.js b/mirage/factories/user.js index c3173100e8..ab6e94f934 100644 --- a/mirage/factories/user.js +++ b/mirage/factories/user.js @@ -3,11 +3,11 @@ import {Factory} from 'ember-cli-mirage'; export default Factory.extend({ accessibility: null, bio: null, - cover: null, + coverImage: null, createdAt: '2015-09-02T13:41:50.000Z', createdBy: null, email(i) { return `user-${i}@example.com`; }, - image: '//www.gravatar.com/avatar/3ae045bc198a157401827c8455cd7c99?s=250&d=mm&r=x', + profileImage: '//www.gravatar.com/avatar/3ae045bc198a157401827c8455cd7c99?s=250&d=mm&r=x', language: 'en_US', lastLogin: '2015-11-02T16:12:05.000Z', location: null, diff --git a/mirage/fixtures/settings.js b/mirage/fixtures/settings.js index b005d151f8..0a4e01004d 100644 --- a/mirage/fixtures/settings.js +++ b/mirage/fixtures/settings.js @@ -32,7 +32,7 @@ export default [ }, { id: 4, - key: 'cover', + key: 'cover_image', value: '/content/images/2014/Feb/cover.jpg', type: 'blog', created_at: '2013-11-25T14:48:11.000Z',