From 79ea7ad4e7588a0d45c2e80b8af0955704f2e15d Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 21 Oct 2016 09:44:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20more=20asset=20paths=20(#3?= =?UTF-8?q?60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - #309 introduced a change to our asset path but some images, particularly around the team page and user avatars were missed, this fixes those URLs to use the new `ghostPaths.assetRoot` helper --- ghost/admin/app/components/gh-posts-list-item.js | 2 +- ghost/admin/app/components/gh-profile-image.js | 4 ++-- ghost/admin/app/components/gh-user-active.js | 2 +- ghost/admin/app/controllers/team/user.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ghost/admin/app/components/gh-posts-list-item.js b/ghost/admin/app/components/gh-posts-list-item.js index a0f21a854f..2e6f66fcee 100644 --- a/ghost/admin/app/components/gh-posts-list-item.js +++ b/ghost/admin/app/components/gh-posts-list-item.js @@ -33,7 +33,7 @@ export default Component.extend(ActiveLinkWrapper, { }), authorAvatar: computed('post.author.image', function () { - return this.get('post.author.image') || `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`; + return this.get('post.author.image') || `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; }), authorAvatarBackground: computed('authorAvatar', function () { diff --git a/ghost/admin/app/components/gh-profile-image.js b/ghost/admin/app/components/gh-profile-image.js index c35f42e06c..2854f1f713 100644 --- a/ghost/admin/app/components/gh-profile-image.js +++ b/ghost/admin/app/components/gh-profile-image.js @@ -44,7 +44,7 @@ export default Component.extend({ }, defaultImage: computed('ghostPaths', function () { - let url = `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`; + let url = `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; return htmlSafe(`background-image: url(${url})`); }), @@ -71,7 +71,7 @@ export default Component.extend({ this.get('ajax').request(gravatarUrl) .catch((error) => { - let defaultImageUrl = `url("${this.get('ghostPaths.subdir')}/ghost/img/user-image.png")`; + let defaultImageUrl = `url("${this.get('ghostPaths.assetRoot')}/img/user-image.png")`; if (isNotFoundError(error)) { this.$('.placeholder-img')[0].style.backgroundImage = htmlSafe(defaultImageUrl); diff --git a/ghost/admin/app/components/gh-user-active.js b/ghost/admin/app/components/gh-user-active.js index 6e91ec453f..3ff5070b4d 100644 --- a/ghost/admin/app/components/gh-user-active.js +++ b/ghost/admin/app/components/gh-user-active.js @@ -11,7 +11,7 @@ export default Component.extend({ ghostPaths: injectService(), userDefault: computed('ghostPaths', function () { - return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`; + return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; }), userImageBackground: computed('user.image', 'userDefault', function () { diff --git a/ghost/admin/app/controllers/team/user.js b/ghost/admin/app/controllers/team/user.js index 21e868738e..2cdfeecef2 100644 --- a/ghost/admin/app/controllers/team/user.js +++ b/ghost/admin/app/controllers/team/user.js @@ -57,7 +57,7 @@ export default Controller.extend({ // duplicated in gh-user-active -- find a better home and consolidate? userDefault: computed('ghostPaths', function () { - return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`; + return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`; }), userImageBackground: computed('user.image', 'userDefault', function () { @@ -68,7 +68,7 @@ export default Controller.extend({ // end duplicated coverDefault: computed('ghostPaths', function () { - return `${this.get('ghostPaths.subdir')}/ghost/img/user-cover.png`; + return `${this.get('ghostPaths.assetRoot')}/img/user-cover.png`; }), coverImageBackground: computed('user.cover', 'coverDefault', function () {