aboutsummaryrefslogtreecommitdiff
path: root/template/assemblies
diff options
context:
space:
mode:
authorMaZderMind2016-08-02 22:11:45 +0200
committerMaZderMind2016-08-02 22:11:45 +0200
commita91df33997fdac99c5f7ed8577adebda0a676ec2 (patch)
treeaf82971f84ad8f4575a864f754cb534b692b4403 /template/assemblies
parent6c526bdf4a28ed6800a0bc827d9d55e215e19be8 (diff)
place schedule elements absolute on calulated positions, fixes wrap-around bug
Diffstat (limited to 'template/assemblies')
-rw-r--r--template/assemblies/schedule.phtml9
1 files changed, 6 insertions, 3 deletions
diff --git a/template/assemblies/schedule.phtml b/template/assemblies/schedule.phtml
index 482ea39..f913b64 100644
--- a/template/assemblies/schedule.phtml
+++ b/template/assemblies/schedule.phtml
@@ -1,15 +1,18 @@
<div class="schedule scroll-container">
<div class="scroll-element">
<div class="now"><span>now</span></div>
- <? foreach($schedule->getSchedule() as $roomname => $events): ?>
- <div class="room <? if($roomname == $room->getSlug()): ?>highlight<? endif ?>" style="width: <?=round($schedule->getDurationSum() / $schedule->getScale()) + 50?>px">
+ <? $rooms = $schedule->getSchedule() ?>
+ <? foreach($rooms as $roomname => $events): ?>
+ <div class="room <? if($roomname == $room->getSlug()): ?>highlight<? endif ?>" style="width: <?=round($schedule->getDurationSum() / $schedule->getScale())?>px">
+ <? $fromstart = 0; ?>
<? foreach($events as $event): ?>
<div
class="block <?=h(@$event['special'] ?: 'event')?>"
- style="width: <?=h(round($event['duration'] / $schedule->getScale()))?>px"
+ 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'])?>"
>
+ <? $fromstart += $event['duration'] ?>
<? $scheduleRoom = Room::createIfExists($roomname) ?>
<? if($scheduleRoom): ?>
<a