xref: /webtrees/resources/views/user-page.phtml (revision 1ff45046fabc22237b5d0d8e489c96f031fc598d)
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 string                 $title
12 * @var Tree                   $tree
13 */
14
15?>
16<h2 class="text-center">
17    <?= $title ?>
18</h2>
19
20<div class="row">
21    <?php if ($main_blocks->isEmpty() || $side_blocks->isEmpty()) : ?>
22        <div class="col-md-12 wt-main-blocks">
23            <?php foreach ($main_blocks->concat($side_blocks) as $block_id => $block) : ?>
24                <?= view('user-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
25            <?php endforeach ?>
26        </div>
27    <?php else : ?>
28        <div class="col-md-8 wt-main-blocks">
29            <?php foreach ($main_blocks as $block_id => $block) : ?>
30                <?= view('user-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
31            <?php endforeach ?>
32        </div>
33        <div class="col-md-4 wt-side-blocks">
34            <?php foreach ($side_blocks as $block_id => $block) : ?>
35                <?= view('user-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
36            <?php endforeach ?>
37        </div>
38    <?php endif ?>
39</div>
40