Added a link menu for quickly navigating school related websites

This commit is contained in:
Bram van der Veen 2015-06-14 23:59:43 +02:00
parent 64857e8d48
commit 2bb72b97a1
7 changed files with 49 additions and 9 deletions

View file

@ -18,7 +18,12 @@ module.exports = function () {
'14:40 - 15:40',
'15:40 - 16:40'
],
'school_id' : 934
'school_id' : 934,
'links' : {
'Login': ['#', '#96AA48'],
'Magister': ['http://werkman.magister.net', '#0C5489'],
'Mail': ['https://login.microsoftonline.com/', '#C41824']
}
}
fs.writeFileSync(__dirname + '/settings.json', JSON.stringify(settings, null, 2));

View file

@ -3,3 +3,5 @@ include header
div.homepage
input.search(type="text", name="searchterm", placeholder="Je naam, id, klassennaam, docentencode, lokaalcode")
button.search Zoeken
include links

View file

@ -0,0 +1,6 @@
//links.jade
div.links
each properties, name in links
div
a(href=properties[0], target='_blank' style='background-color:' + properties[1])=name

View file

@ -18,8 +18,10 @@ div.schedule
span.course= hour.course
if match.json.indexOf(day) == 0
span.time= match.times[match.json[0].indexOf(hour)]
span.time= times[match.json[0].indexOf(hour)]
else
div.hour.changed
span.free Vrij
include links

View file

@ -118,5 +118,33 @@ div.schedule {
}
}
}
}
.links {
width: 100%;
position: fixed;
bottom: -90px;
transition: ease .5s;
&:hover {
bottom: 0px;
transition: ease .5s;
}
div {
height: 100px;
width: calc(100% / 3);
float: left;
a {
text-decoration: none;
height: 100%;
width: 100%;
display: inline-block;
color: #FFF;
text-align: center;
font-size: 60px;
}
}
}

View file

@ -7,7 +7,6 @@ var config = require('./configuration');
function schedule(req, res, next) {
get(req.match.url, function (json) {
req.match.json = json;
req.match.times = config().hour_times;
next();
});
}

8
web.js
View file

@ -14,11 +14,9 @@ app.use('/css', less(__dirname + '/resources/less'));
app.use('/js', express.static(__dirname + '/resources/js'));
app.get('/', function (req, res) {
res.render('homepage');
});
app.post('/', function (req, res) {
console.log(req);
req.links = config().links;
console.log(req.links);
res.render('homepage', req);
});
app.get('/rooster/:search', function (req, res) {