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
This commit is contained in:
parent
3781e486f7
commit
5575015e33
|
@ -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>
|
||||
|
|
|
@ -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…
Reference in New Issue