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