From da0a0c559b09d5f5e27271e405553e242f2cf763 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 14 Jan 2016 16:25:29 +0000 Subject: [PATCH] Move user/cover image files used in admin team area into the client folder no issue - fixes potential "mixed content" warnings if non-admin urls are redirected --- core/client/app/components/gh-posts-list-item.js | 2 +- core/client/app/components/gh-profile-image.js | 2 +- core/client/app/components/gh-user-active.js | 2 +- core/client/app/controllers/team/user.js | 4 ++-- .../public/assets}/img/user-cover.png | Bin .../public/assets}/img/user-image.png | Bin core/test/functional/routes/frontend_spec.js | 7 ------- 7 files changed, 5 insertions(+), 12 deletions(-) rename core/{shared => client/public/assets}/img/user-cover.png (100%) rename core/{shared => client/public/assets}/img/user-image.png (100%) diff --git a/core/client/app/components/gh-posts-list-item.js b/core/client/app/components/gh-posts-list-item.js index b0fe972172..c1bb1a827f 100644 --- a/core/client/app/components/gh-posts-list-item.js +++ b/core/client/app/components/gh-posts-list-item.js @@ -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 () { diff --git a/core/client/app/components/gh-profile-image.js b/core/client/app/components/gh-profile-image.js index 75963b1c48..d0b5687420 100644 --- a/core/client/app/components/gh-profile-image.js +++ b/core/client/app/components/gh-profile-image.js @@ -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})`); }), diff --git a/core/client/app/components/gh-user-active.js b/core/client/app/components/gh-user-active.js index c333dce4bc..304ad43af9 100644 --- a/core/client/app/components/gh-user-active.js +++ b/core/client/app/components/gh-user-active.js @@ -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 () { diff --git a/core/client/app/controllers/team/user.js b/core/client/app/controllers/team/user.js index 6638555c1a..12670041f9 100644 --- a/core/client/app/controllers/team/user.js +++ b/core/client/app/controllers/team/user.js @@ -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 () { @@ -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 () { diff --git a/core/shared/img/user-cover.png b/core/client/public/assets/img/user-cover.png similarity index 100% rename from core/shared/img/user-cover.png rename to core/client/public/assets/img/user-cover.png diff --git a/core/shared/img/user-image.png b/core/client/public/assets/img/user-image.png similarity index 100% rename from core/shared/img/user-image.png rename to core/client/public/assets/img/user-image.png diff --git a/core/test/functional/routes/frontend_spec.js b/core/test/functional/routes/frontend_spec.js index 65d68db665..4fd651a86e 100644 --- a/core/test/functional/routes/frontend_spec.js +++ b/core/test/functional/routes/frontend_spec.js @@ -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)