From 5575015e33d400cc03db133a8ea8b7ca39d7af2f Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Fri, 2 Feb 2018 13:30:05 +0100 Subject: [PATCH] Do not display room if not reservable on the day Stop displaying a line for a room in "additional tracks" if it's actually not reservable at all during that day. Change-Id: If7063b8bf00531cd154f49c3a3fbc88b1e16fa3f --- html/ptg.html | 2 ++ html/ptg.js | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/html/ptg.html b/html/ptg.html index 54bf0d5..81d0259 100644 --- a/html/ptg.html +++ b/html/ptg.html @@ -109,6 +109,7 @@ {{/each}} {{#each @root.additional as |schedule room|}} + {{#if (roomactive schedule times)}} {{room}} {{#each (lookup @root.slots day) as |time|}} {{#if (lookup schedule time.name)}} @@ -118,6 +119,7 @@ {{/if}} {{/each}} + {{/if}} {{/each}} diff --git a/html/ptg.js b/html/ptg.js index 94dd244..4d5ff63 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -18,6 +18,15 @@ Handlebars.registerHelper('hashtag', function(options) { return new Handlebars.SafeString(sentence); }); +Handlebars.registerHelper('roomactive', function(schedule, times) { + for (var i=0; i