Browse Source

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
changes/63/540363/1
Thierry Carrez 3 years ago
parent
commit
5575015e33
2 changed files with 11 additions and 0 deletions
  1. +2
    -0
      html/ptg.html
  2. +9
    -0
      html/ptg.js

+ 2
- 0
html/ptg.html View File

@ -109,6 +109,7 @@
{{/each}}
</tr></thead>
{{#each @root.additional as |schedule room|}}
{{#if (roomactive schedule times)}}
<tr><td>{{room}}</td>
{{#each (lookup @root.slots day) as |time|}}
{{#if (lookup schedule time.name)}}
@ -118,6 +119,7 @@
{{/if}}
{{/each}}
</tr>
{{/if}}
{{/each}}
</table>
</div>


+ 9
- 0
html/ptg.js View File

@ -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<times.length; i++) {
if (schedule[times[i]['name']] != undefined) {
return true;
}
}
return false;
});
Handlebars.registerHelper('roomcode', function(schedule, room, timecode) {
if (schedule[timecode] == "") {
return room + "-" + timecode;


Loading…
Cancel
Save