From 3781e486f76cabf8902a28256be30a9a7a2edfcf Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Fri, 2 Feb 2018 13:10:36 +0100 Subject: [PATCH] Do not display slotrefs for unreservable slots Stop displaying slot reference codes in the "additional tracks" table if the slot is actually not bookable Change-Id: I367d75bcfc289475d28df2bbd524adda059f4b05 --- html/ptg.html | 2 +- html/ptg.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/html/ptg.html b/html/ptg.html index d58e6b8..54bf0d5 100644 --- a/html/ptg.html +++ b/html/ptg.html @@ -114,7 +114,7 @@ {{#if (lookup schedule time.name)}} {{lookup schedule time.name}} {{else}} - {{room}}-{{time.name}} + {{roomcode schedule room time.name}} {{/if}} {{/each}} diff --git a/html/ptg.js b/html/ptg.js index 0612dc6..94dd244 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -18,6 +18,13 @@ Handlebars.registerHelper('hashtag', function(options) { return new Handlebars.SafeString(sentence); }); +Handlebars.registerHelper('roomcode', function(schedule, room, timecode) { + if (schedule[timecode] == "") { + return room + "-" + timecode; + } + return ""; +}); + // What is the day today ? var now = new Date(); var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];