aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authordedeibel2018-05-12 17:28:04 +0200
committerdedeibel2018-05-12 17:28:04 +0200
commit7dc56fec2d7724b6dc909936ad63d6888bbdd309 (patch)
treeb6da0fbfc75d2acb379270e026d5b0aa950492a9 /template
parentce811ee001a7f8f4e30148d73cccdd33edf942de (diff)
Fix handling of wide room entries which causes problems on small screens because of missing clearfix entries. Additionally fixing handling of the last line when declaring odd room indizes as wide entries.
Diffstat (limited to '')
-rw-r--r--template/overview.phtml29
1 files changed, 22 insertions, 7 deletions
diff --git a/template/overview.phtml b/template/overview.phtml
index 513f8e5..410c835 100644
--- a/template/overview.phtml
+++ b/template/overview.phtml
@@ -13,17 +13,29 @@
<? $count = count($rooms); $idx = 0 ?>
<? foreach($rooms as $room): ?>
+ <?
+ $is_wide = 0;
+ /* when the count is odd and this is the last item - make it full width */
+ if (($count % 2 == 1) && ($idx == $count - 1)) {
+ $is_wide = 1;
+ }
+ elseif ($room->requestsWide()) {
+ $is_wide = 1;
+ $count++;
+ /* Increase the index if we are using a whole line, this means when the room is
+ * an even entry. Odd entries on the other hand steal one index from the
+ * "previous" row which they originally belong to. */
+ if ($idx % 2 != 1) {
+ $idx++;
+ }
+ }
+ ?>
+
<div class="
room
room-<?=h($room->getSlug())?>
clearfix
-
- <? /* when the count is odd and this is the last item - make it full width */ ?>
- <? if( ($count % 2 == 1) && ($idx == $count - 1) ): ?>
- wide
- col-xs-12
- <? elseif($room->requestsWide()): ?>
- <? $count++; $idx++ ?>
+ <? if ($is_wide): ?>
wide
col-xs-12
<? else: ?>
@@ -83,6 +95,9 @@
</a>
</div>
<? $idx++ ?>
+ <? if ($is_wide): ?>
+ <div class="clearfix"></div>
+ <? endif ?>
<? endforeach ?>
</div>
<? endforeach ?>