Added module for giving the time to the system.
This commit is contained in:
parent
adb8393479
commit
6a082e4156
|
@ -13,7 +13,7 @@ html
|
||||||
script(type="text/javascript", src="/js/script.js")
|
script(type="text/javascript", src="/js/script.js")
|
||||||
script(type="text/javascript").
|
script(type="text/javascript").
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-46880644-1', 'werkmanrooster.nl');ga('send', 'pageview');ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-46880644-1', 'werkmanrooster.nl');ga('send', 'pageview');ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
|
||||||
body
|
body(class=app.locals.time.get() > 20.5 ? 'night' : '')
|
||||||
div.bar
|
div.bar
|
||||||
if headers.user
|
if headers.user
|
||||||
ul.left
|
ul.left
|
||||||
|
@ -26,15 +26,14 @@ html
|
||||||
li |
|
li |
|
||||||
li
|
li
|
||||||
a(href="/klassenlijst/#{headers.user.group}") Jouw Klassenlijst
|
a(href="/klassenlijst/#{headers.user.group}") Jouw Klassenlijst
|
||||||
|
|
||||||
ul.right
|
ul.right
|
||||||
li
|
li
|
||||||
a(href="/logout") Logout
|
a(href="/logout") Logout
|
||||||
li |
|
li |
|
||||||
li
|
li
|
||||||
a(href="http://git.werkmanrooster.nl/werkmanrooster/rooster-io.git", target="_blank") Recente ontwikkelingen
|
a(href="http://git.werkmanrooster.nl/werkmanrooster/rooster-io.git", target="_blank") Recente ontwikkelingen
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
ul
|
ul
|
||||||
li
|
li
|
||||||
|
|
17
time.js
Normal file
17
time.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
//time.js
|
||||||
|
|
||||||
|
//Function for getting the time, with minutes as a fracture.
|
||||||
|
function get() {
|
||||||
|
var time = new Date();
|
||||||
|
return time.getHours() + (time.getMinutes() / 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Function for parsing and checking if the currrent time is within the parsed string.
|
||||||
|
function within_timespan(timespan) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
'get': get,
|
||||||
|
'within_timespan': within_timespan
|
||||||
|
}
|
2
web.js
2
web.js
|
@ -10,6 +10,7 @@ var lookup = require('./lookup');
|
||||||
var schedule = require('./schedule');
|
var schedule = require('./schedule');
|
||||||
var auth = require('./auth');
|
var auth = require('./auth');
|
||||||
var redirecter = require('./redirecter');
|
var redirecter = require('./redirecter');
|
||||||
|
var time = require('./time');
|
||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ app.set('views', __dirname + '/resources/jade');
|
||||||
//Give the app some configuration information
|
//Give the app some configuration information
|
||||||
app.locals.linkbar = config().linkbar;
|
app.locals.linkbar = config().linkbar;
|
||||||
app.locals.hour_times = config().hour_times;
|
app.locals.hour_times = config().hour_times;
|
||||||
|
app.locals.time = time;
|
||||||
|
|
||||||
//Set up all static directories for getting resources.
|
//Set up all static directories for getting resources.
|
||||||
app.use('/css', less(__dirname + '/resources/less'));
|
app.use('/css', less(__dirname + '/resources/less'));
|
||||||
|
|
Loading…
Reference in a new issue