diff --git a/html/ptg.html b/html/ptg.html index d4a6855..fcea522 100644 --- a/html/ptg.html +++ b/html/ptg.html @@ -112,7 +112,7 @@ {{#each times as |time|}} - + {{/each}} {{#each @root.schedule as |sched room|}} @@ -121,7 +121,7 @@ {{/if}} {{#each (lookup @root.slots day) as |time|}} - + {{/each}} {{/if}} diff --git a/html/ptg.js b/html/ptg.js index 237484d..cd3848b 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -120,6 +120,19 @@ Handlebars.registerHelper('displaytime', return new Handlebars.SafeString(content); }); +// Grey out cell if current time matches the slot hour +Handlebars.registerHelper('activetime', + function(time) { + if (time['realtime'] != undefined) { + var t = new Date(time['realtime']); + var now = new Date(); + var diff = now.getTime() - t.getTime(); + if (diff > 0 && diff < (1000*60*60)) { + return new Handlebars.SafeString('style="background-color: #eeeeee"'); + } + } + return new Handlebars.SafeString(''); +}); // What is the day today ? // Return Monday until Tuesday 1 UTC
{{ displaytime time }}{{ displaytime time }}
{{ roomcode @root.urls @root.schedule room time.name 0 }}{{ roomcode @root.urls @root.schedule room time.name 0 }}