Added support for showing the current hour

This commit is contained in:
Bram van der Veen 2015-08-15 18:00:56 +02:00
parent d540139194
commit d7192b8e6d
3 changed files with 12 additions and 3 deletions

View file

@ -20,8 +20,9 @@ if !easter || easter.type != "RIP"
.hour.title .hour.title
span= days[match.json.indexOf(day)] span= days[match.json.indexOf(day)]
each hour in day each hour in day
- var current = app.locals.time.within_timespan(app.locals.hour_times[day.indexOf(hour)]);
if hour.teacher != 'vrij' if hour.teacher != 'vrij'
.hour(class=(hour.changed == 'true' ? 'changed' : '')) .hour(class=((hour.changed == 'true' ? 'changed' : '') + (current ? ' current' : '')))
each subhour in hour.teacher each subhour in hour.teacher
span.teacher(class='sub_' + hour.teacher.length) span.teacher(class='sub_' + hour.teacher.length)
a(href=hour.teacher[hour.teacher.indexOf(subhour)])= hour.teacher[hour.teacher.indexOf(subhour)] a(href=hour.teacher[hour.teacher.indexOf(subhour)])= hour.teacher[hour.teacher.indexOf(subhour)]
@ -33,8 +34,10 @@ if !easter || easter.type != "RIP"
span.time= app.locals.hour_times[match.json[0].indexOf(hour)] span.time= app.locals.hour_times[match.json[0].indexOf(hour)]
else else
.hour.changed .hour.changed(class= current ? ' current' : '')
span.free Vrij span.free Vrij
if match.json.indexOf(day) == 0
span.time= app.locals.hour_times[match.json[0].indexOf(hour)]
else else
.schedule.rip .schedule.rip
h1 R.I.P h1 R.I.P

View file

@ -257,6 +257,7 @@ div.schedule {
border-bottom: solid 1px #000; border-bottom: solid 1px #000;
border-left: solid 1px #000; border-left: solid 1px #000;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
} }
@ -296,6 +297,12 @@ div.schedule {
color: red !important; color: red !important;
} }
&.current {
background-color: #0C5489;
color: #FFF;
text-shadow: 0px -1px 0px #020000;
}
&.title { &.title {
text-align: center; text-align: center;
background-color: #000; background-color: #000;

View file

@ -38,4 +38,3 @@ module.exports = {
'within_timespan': within_timespan, 'within_timespan': within_timespan,
'during_school': during_school 'during_school': during_school
} }