Skip to content

Commit

Permalink
Move user/cover image files used in admin team area into the client f…
Browse files Browse the repository at this point in the history
…older

no issue
- fixes potential "mixed content" warnings if non-admin urls are redirected
  • Loading branch information
kevinansfield committed Jan 14, 2016
1 parent 749bd29 commit da0a0c5
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/client/app/components/gh-posts-list-item.js
Expand Up @@ -22,7 +22,7 @@ export default Component.extend(ActiveLinkWrapper, {
}),

authorAvatar: computed('post.author.image', function () {
return this.get('post.author.image') || this.get('ghostPaths.url').asset('/shared/img/user-image.png');
return this.get('post.author.image') || `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`;
}),

authorAvatarBackground: computed('authorAvatar', function () {
Expand Down
2 changes: 1 addition & 1 deletion core/client/app/components/gh-profile-image.js
Expand Up @@ -36,7 +36,7 @@ export default Component.extend({
},

defaultImage: computed('ghostPaths', function () {
let url = this.get('ghostPaths.url').asset('/shared/img/user-image.png');
let url = `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`;
return Ember.String.htmlSafe(`background-image: url(${url})`);
}),

Expand Down
2 changes: 1 addition & 1 deletion core/client/app/components/gh-user-active.js
Expand Up @@ -10,7 +10,7 @@ export default Component.extend({
ghostPaths: inject.service('ghost-paths'),

userDefault: computed('ghostPaths', function () {
return this.get('ghostPaths.url').asset('/shared/img/user-image.png');
return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`;
}),

userImageBackground: computed('user.image', 'userDefault', function () {
Expand Down
4 changes: 2 additions & 2 deletions core/client/app/controllers/team/user.js
Expand Up @@ -50,7 +50,7 @@ export default Controller.extend(ValidationEngine, {

// duplicated in gh-user-active -- find a better home and consolidate?
userDefault: computed('ghostPaths', function () {
return this.get('ghostPaths.url').asset('/shared/img/user-image.png');
return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`;
}),

userImageBackground: computed('user.image', 'userDefault', function () {
Expand All @@ -61,7 +61,7 @@ export default Controller.extend(ValidationEngine, {
// end duplicated

coverDefault: computed('ghostPaths', function () {
return this.get('ghostPaths.url').asset('/shared/img/user-cover.png');
return `${this.get('ghostPaths.subdir')}/ghost/img/user-cover.png`;
}),

coverImageBackground: computed('user.cover', 'coverDefault', function () {
Expand Down
File renamed without changes
File renamed without changes
7 changes: 0 additions & 7 deletions core/test/functional/routes/frontend_spec.js
Expand Up @@ -243,13 +243,6 @@ describe('Frontend Routing', function () {
});

describe('Static assets', function () {
it('should retrieve shared assets', function (done) {
request.get('/shared/img/user-image.png')
.expect('Cache-Control', testUtils.cacheRules.hour)
.expect(200)
.end(doEnd(done));
});

it('should retrieve theme assets', function (done) {
request.get('/assets/css/screen.css')
.expect('Cache-Control', testUtils.cacheRules.year)
Expand Down

0 comments on commit da0a0c5

Please sign in to comment.