xref: /webtrees/resources/views/tree-page.phtml (revision 2ebcf907ed34213f816592af04e6c160335d6311)
1<?php
2
3use Fisharebest\Webtrees\Tree;
4use Illuminate\Support\Collection;
5
6/**
7 * @var Collection<int,string> $main_blocks
8 * @var Collection<int,string> $side_blocks
9 * @var Tree                   $tree
10 */
11
12?>
13<div class="row">
14    <?php if ($main_blocks->isEmpty() || $side_blocks->isEmpty()) : ?>
15        <div class="col-md-12 wt-main-blocks">
16            <?php foreach ($main_blocks->concat($side_blocks) as $block_id => $block) : ?>
17                <?= view('tree-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
18            <?php endforeach ?>
19        </div>
20    <?php else : ?>
21        <div class="col-md-8 wt-main-blocks">
22            <?php foreach ($main_blocks as $block_id => $block) : ?>
23                <?= view('tree-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
24            <?php endforeach ?>
25        </div>
26        <div class="col-md-4 wt-side-blocks">
27            <?php foreach ($side_blocks as $block_id => $block) : ?>
28                <?= view('tree-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
29            <?php endforeach ?>
30        </div>
31    <?php endif ?>
32</div>
33