Fully intergrated new way of supplying configuration variables.

This commit is contained in:
Bram van der Veen 2015-07-22 15:54:11 +02:00
parent cc2e7cf806
commit 602251df4c
3 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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

4
web.js
View file

@ -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'));