diff options
author | Anton Schubert | 2020-10-31 20:43:09 +0100 |
---|---|---|
committer | GitHub | 2020-10-31 20:43:09 +0100 |
commit | c31a16cb6d9057883cc5f46376c190a8a8736546 (patch) | |
tree | dfe4bd1853fffd259f01a2ad920f6ae00cb44bb8 /template | |
parent | 84b8eb8048fcdb8e6449583583aa21b7bb90486e (diff) |
preserve schedule timezones and show current time + event timezone on the website (#117)
Diffstat (limited to 'template')
-rw-r--r-- | template/assemblies/header.phtml | 6 | ||||
-rw-r--r-- | template/assemblies/schedule.phtml | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/template/assemblies/header.phtml b/template/assemblies/header.phtml index 43c6494..f7051f1 100644 --- a/template/assemblies/header.phtml +++ b/template/assemblies/header.phtml @@ -22,6 +22,12 @@ <span class="fa fa-info"></span> </a> </div> + + <? if(isset($room) && $room->hasSchedule()): ?> + <div class="navbar-right navbar-time"> + Current Time + </div> + <? endif ?> </div> </nav> diff --git a/template/assemblies/schedule.phtml b/template/assemblies/schedule.phtml index fe0ccbb..2680a44 100644 --- a/template/assemblies/schedule.phtml +++ b/template/assemblies/schedule.phtml @@ -1,10 +1,14 @@ <div class="schedule scroll-container"> <div class="scroll-element"> - <div class="now"><span>now</span></div> + <? $totalWidth = round($schedule->getDurationSum() / $schedule->getScale()) ?> + <div class="now" style="width: <?= h($totalWidth) ?>px"> + <div class="overlay"></div> + <div class="label">now</div> + </div> <? $rooms = $schedule->getSchedule() ?> <? foreach($rooms as $roomname => $events): ?> <? $scheduleRoom = $schedule->getMappedRoom($roomname) ?> - <div class="room <? if(isset($room) && $roomname == $room->getScheduleName()): ?>highlight<? endif ?>" style="width: <?=round($schedule->getDurationSum() / $schedule->getScale())?>px"> + <div class="room <? if(isset($room) && $roomname == $room->getScheduleName()): ?>highlight<? endif ?>" style="width: <?= h($totalWidth) ?>px"> <? $fromstart = 0; ?> <? foreach($events as $event): ?> <div @@ -12,6 +16,7 @@ style="width: <?=h(round($event['duration'] / $schedule->getScale()))?>px; left: <?=h(round($fromstart / $schedule->getScale()))?>px" data-start="<?=intval($event['start'])?>" data-end="<?=intval($event['end'])?>" + data-offset="<?=intval($event['offset']/60)?>" > <? $fromstart += $event['duration'] ?> <? if($scheduleRoom): ?> @@ -42,9 +47,9 @@ <? else: ?> <? if($event['duration'] > 10*60): /* only display when event is longer as 10 minutes */ ?> - <h4><?=h(strftime('%H:%M', $event['start']))?> + <h4><?=h($event['tstart'])?> – - <?=h(strftime('%H:%M', $event['end']))?> + <?=h($event['tend'])?> in <?=h($scheduleRoom ? $scheduleRoom->getDisplayShort() : $roomname) ?> </h4> |