Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
🐛 fix more asset paths (#360)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kevinansfield authored and ErisDS committed Oct 21, 2016
1 parent fd0caa0 commit 3fe6124
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/gh-posts-list-item.js
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-profile-image.js
Expand Up @@ -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})`);
}),

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-user-active.js
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/team/user.js
Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand Down

0 comments on commit 3fe6124

Please sign in to comment.