allow rooms to be forced to full-width

This commit is contained in:
MaZderMind 2015-12-20 16:41:39 +01:00
parent 83d4c7d017
commit cfecaf7734
2 changed files with 11 additions and 2 deletions

View file

@ -72,6 +72,10 @@ class Room extends ModelBase
return $this->get('ROOMS.'.$this->getSlug().'.PREVIEW');
}
public function requestsWide() {
return $this->get('ROOMS.'.$this->getSlug().'.WIDE');
}
public function hasSchedule() {
return $this->get('ROOMS.'.$this->getSlug().'.SCHEDULE') && $this->has('SCHEDULE');
}

View file

@ -17,8 +17,8 @@
<? endif ?>
<div class="row room-group room-group-n<?=h($i++)?>">
<? $count = count($rooms); ?>
<? foreach($rooms as $idx => $room): ?>
<? $count = count($rooms); $idx = 0 ?>
<? foreach($rooms as $room): ?>
<div class="
room
room-<?=h($room->getSlug())?>
@ -28,6 +28,10 @@
<? if( ($count % 2 == 1) && ($idx == $count - 1) ): ?>
wide
col-xs-12
<? elseif($room->requestsWide()): ?>
<? $count++; $idx++ ?>
wide
col-xs-12
<? else: ?>
narrow
<? if($room->hasPreview() && $room->hasSchedule()): ?>
@ -89,6 +93,7 @@
</div>
</div>
</div>
<? $idx++ ?>
<? endforeach ?>
</div>
<? endforeach ?>