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