Made the schedule render.

This commit is contained in:
Bram van der Veen 2015-06-14 14:46:28 +02:00
parent 2970d0386e
commit 9be6daa221
4 changed files with 24 additions and 1 deletions

View file

@ -1 +1,10 @@
include header
div.schedule
each day in json
div.day
each hour in day
div.hour
span.teacher= hour.teacher
span.chamber= hour.chamber
span.course= hour.course

View file

@ -44,3 +44,16 @@
background-color: #96aa48;
margin-bottom: 50px;
}
div.schedule {
display: table;
div.day {
float: left;
div.hour {
height: 20px;
}
}
}

View file

@ -45,7 +45,7 @@ function to_json(page) {
var amount_of_special_hours = schedule.find('table').eq(0).children().length;
for (special_hour = 0; special_hour < amount_of_special_hours; special_hour++) {
schedule_data[day][hour] = {teacher: [], chamber: [], course: [], changed: []};
var selected_hour = schedule.find('table').eq(0).find('tr').eq(special_hour).find('td');
var selected_hour = schedule.find('table').eq(day).find('tr').eq(special_hour).find('td');
schedule_data[day][hour].teacher[special_hour] = selected_hour.eq(0).html();
schedule_data[day][hour].chamber[special_hour] = selected_hour.eq(2).html();

1
web.js
View file

@ -33,6 +33,7 @@ app.param('search', schedule);
app.param('search', function (req, res) {
res.render('schedule', req.match);
console.log(req.match.json[0][0]);
});
app.listen(1024);