From 9a7aafd64bca2c77b164ea131f5764ba1e5b07d4 Mon Sep 17 00:00:00 2001 From: "robinwilliam.hundt" <robinwilliam.hundt@stud.uni-goettingen.de> Date: Mon, 19 Feb 2018 08:43:27 +0100 Subject: [PATCH] Dynamic brand img url --- frontend/src/components/BaseLayout.vue | 9 ++++++++- frontend/src/components/WelcomeJumbotron.vue | 2 +- frontend/src/pages/Login.vue | 11 +++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/BaseLayout.vue b/frontend/src/components/BaseLayout.vue index e35887cc..751236c1 100644 --- a/frontend/src/components/BaseLayout.vue +++ b/frontend/src/components/BaseLayout.vue @@ -50,7 +50,8 @@ <v-toolbar-title> <router-link to="/home"> <v-avatar> - <img src="../assets/brand.png"> + <img v-if="production" :src="productionBrandUrl"/> + <img v-else src="../assets/brand.png"/> </v-avatar> </router-link> </v-toolbar-title> @@ -84,6 +85,12 @@ set: function (collapsed) { this.$store.commit(uiMut.SET_SIDEBAR_COLLAPSED, collapsed) } + }, + production () { + return process.env.NODE_ENV === 'production' + }, + productionBrandUrl () { + return `https://${window.location.host}/static/img/brand.png` } }, methods: { diff --git a/frontend/src/components/WelcomeJumbotron.vue b/frontend/src/components/WelcomeJumbotron.vue index 0398e647..9a720a48 100644 --- a/frontend/src/components/WelcomeJumbotron.vue +++ b/frontend/src/components/WelcomeJumbotron.vue @@ -30,7 +30,7 @@ name: 'welcome-jumbotron', data () { return { - gradient: 'to bottom, #1A237E, #97A1DD' + gradient: 'to bottom, #1A237E, #5753DD' } } } diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 0035b112..5ae6b8e2 100644 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -2,7 +2,8 @@ <v-container fill-height> <v-layout align-center justify-center> <v-flex text-xs-center xs8 sm6 md4 lg2> - <img src="../assets/brand.png"/> + <img v-if="production" :src="productionBrandUrl"/> + <img v-else src="../assets/brand.png"/> <h3 class="pt-3">Log in</h3> <v-alert outline @@ -52,7 +53,13 @@ ...mapState({ msg: state => state.authentication.message, userRole: state => state.authentication.userRole - }) + }), + production () { + return process.env.NODE_ENV === 'production' + }, + productionBrandUrl () { + return `https://${window.location.host}/static/img/brand.png` + } }, methods: { ...mapActions([ -- GitLab