From adbd5e49577cd30f8bc1188eaa5f96117496c910 Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Thu, 8 Feb 2018 14:08:12 +0100 Subject: [PATCH] Single table for scheduled and additional rooms Collapse the "scheduled" and "additional" tracks tables into a single table. This extends the "roomcode" helper to be smart enough to guess what the cell should contain. Change-Id: I60887d5da0878820817f17c9f4fd1aa20f546aac --- html/ptg.html | 41 +++-------------------------------------- html/ptg.js | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 44 deletions(-) diff --git a/html/ptg.html b/html/ptg.html index 81d0259..55dc12a 100644 --- a/html/ptg.html +++ b/html/ptg.html @@ -78,45 +78,10 @@ {{/each}} {{#each @root.scheduled as |schedule room|}} + {{#if (roomactive @root.scheduled @root.additional room times)}} {{room}} {{#each (lookup @root.slots day) as |time|}} - {{lookup schedule time.name}} - {{/each}} - - {{/each}} - - - {{/each}} - - - -
-

Additional tracks

-
- - -
- {{#each slots as |times day|}} -
- - - {{#each times as |time|}} - - {{/each}} - - {{#each @root.additional as |schedule room|}} - {{#if (roomactive schedule times)}} - - {{#each (lookup @root.slots day) as |time|}} - {{#if (lookup schedule time.name)}} - - {{else}} - - {{/if}} + {{/each}} {{/if}} @@ -125,7 +90,7 @@ {{/each}} - Use #TRACK book SLOTREF to book one of those empty slots + Use '#TRACK book SLOTREF' to book one of the empty slots with the ptgbot

Content on this page is being driven by room operators through the openstackptg bot on the #openstack-ptg IRC channel. It was last refreshed on {{timestamp}}.

diff --git a/html/ptg.js b/html/ptg.js index 4d5ff63..8344d1d 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -18,20 +18,44 @@ Handlebars.registerHelper('hashtag', function(options) { return new Handlebars.SafeString(sentence); }); -Handlebars.registerHelper('roomactive', function(schedule, times) { +Handlebars.registerHelper('roomactive', + function(scheduled, additional, room, times) { for (var i=0; i' + scheduled[room][timecode]; + return new Handlebars.SafeString(cell); + } else { + if (additional[room]) { + console.log(additional[room][timecode]); + if (additional[room][timecode] != undefined) { + if (additional[room][timecode] == "") { + cell = '' + room + "-" + timecode + ''; + } else { + cell = '' + additional[room][timecode]; + } + } + } } - return ""; + return new Handlebars.SafeString(cell); }); // What is the day today ?
{{time.desc}}
{{room}}{{lookup schedule time.name}}{{roomcode schedule room time.name}}{{ roomcode @root.scheduled @root.additional room time.name }}