From 03c22460461d071944e6cd73c39f204ab5402f0b Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 6 Jan 2019 16:40:11 +0100 Subject: Update logo on error page --- routes/index.js | 4 +++- views/redirect.jade | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/routes/index.js b/routes/index.js index 4876d67..e0b4d27 100644 --- a/routes/index.js +++ b/routes/index.js @@ -9,6 +9,7 @@ router.get('/', function (req, res, next) { const baseMeetingpointUrl = process.env.SCHOOL_LEVEL === 'mavo' ? 'http://www.meetingpointmco.nl/Roosters-AL/TOSweb' : 'http://www.meetingpointmco.nl/Roosters-AL/doc'; + const school = process.env.SCHOOL === 'kiemm' ? 'kiemm' : 'metis'; getMeetingpointData().then(data => { let flags = [] @@ -20,7 +21,7 @@ router.get('/', function (req, res, next) { const usersStr = `var USERS = ${JSON.stringify(data.users)};` const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}` res.render('index', { - school: process.env.SCHOOL === 'kiemm' ? 'kiemm' : 'metis', + school, schoolLevel: process.env.SCHOOL_LEVEL === 'mavo' ? 'mavo' : 'havo-vwo', baseMeetingpointUrl, flagsStr, @@ -30,6 +31,7 @@ router.get('/', function (req, res, next) { }).catch(function () { console.error('Unable to get user info, emergency redirect!') res.render('redirect', { + school, baseMeetingpointUrl, }) }) diff --git a/views/redirect.jade b/views/redirect.jade index 31b2322..1f30451 100644 --- a/views/redirect.jade +++ b/views/redirect.jade @@ -7,22 +7,22 @@ block head text-align: center; margin: 32px; } - + .content { max-width: 600px; margin: 0 auto; } - + h1 { color: #212121; margin-bottom: 32px; } - + h2 { color: #727272; margin-bottom: 64px; } - + a, a:visited { margin: 8px; padding: 8px 16px; @@ -32,7 +32,7 @@ block head font-weight: bold; border-radius: 3px; } - + a:hover, a:focus, a:active { background-color: #e45a3f; } @@ -40,8 +40,11 @@ block head block content .content script document.body.style.opacity = 1 - img(src='/icons/mml-logo.png') + if school === 'kiemm' + img(src='/icons/logo.svg', width="130") + else + img(src='/icons/logo.png') h1 Er is iets mis gegaan tijdens het ophalen van de benodigde informatie h2 Je kunt proberen door te gaan naar het oude rooster of Magister - a(href=baseMeetingpointUrl) Oud rooster - a(href='http://msa.magister.net/') Magister + a(href=baseMeetingpointUrl) Oud rooster + a(href='http://msa.magister.net/') Magister -- cgit v1.1