From 602251df4c731e0d5047a8e95f6a3bd237e64c7b Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Wed, 22 Jul 2015 15:54:11 +0200 Subject: [PATCH] Fully intergrated new way of supplying configuration variables. --- resources/jade/links.jade | 4 ++-- resources/jade/schedule.jade | 2 +- web.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/jade/links.jade b/resources/jade/links.jade index c847bd5..661f768 100644 --- a/resources/jade/links.jade +++ b/resources/jade/links.jade @@ -1,6 +1,6 @@ -//links.jade +//- links.jade div.links - each properties, name in links + each properties, name in app.locals.linkbar div a(href=properties[0], style='background-color:' + properties[1])=name diff --git a/resources/jade/schedule.jade b/resources/jade/schedule.jade index 9ad42a1..e393844 100644 --- a/resources/jade/schedule.jade +++ b/resources/jade/schedule.jade @@ -30,7 +30,7 @@ if !easter || easter.type != "RIP" span.course(class='sub_' + hour.teacher.length)= hour.course[hour.teacher.indexOf(subhour)] if match.json.indexOf(day) == 0 - span.time= times[match.json[0].indexOf(hour)] + span.time= app.locals.hour_times[match.json[0].indexOf(hour)] else .hour.changed diff --git a/web.js b/web.js index 22d6d7a..fffdbdb 100644 --- a/web.js +++ b/web.js @@ -18,8 +18,8 @@ config().env == 'dev' ? app.disable('view cache') : null; //If the environment i app.set('views', __dirname + '/resources/jade'); //Give the app some configuration information -app.local.linkbar = config().linkbar; -app.local.hour_times = config().hour_times; +app.locals.linkbar = config().linkbar; +app.locals.hour_times = config().hour_times; //Set up all static directories for getting resources. app.use('/css', less(__dirname + '/resources/less'));