xref: /webtrees/resources/views/family-page.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Fact;
6use Fisharebest\Webtrees\Family;
7use Fisharebest\Webtrees\I18N;
8use Illuminate\Support\Collection;
9
10/**
11 * @var bool                 $can_upload_media
12 * @var Collection<int,Fact> $clipboard_facts
13 * @var Collection<int,Fact> $facts
14 * @var Family               $record
15 */
16
17?>
18
19<?= view('family-page-pending', ['record' => $record]) ?>
20
21<div class="d-flex mb-4">
22    <h2 class="wt-page-title mx-auto">
23        <?= $record->fullName() ?>
24    </h2>
25    <?php if ($record->canEdit()) : ?>
26        <?= view('family-page-menu', ['can_upload_media' => $can_upload_media, 'clipboard_facts' => $clipboard_facts, 'record' => $record]) ?>
27    <?php endif ?>
28</div>
29
30<div class="wt-page-content">
31    <div class="wt-family-members d-flex">
32        <?= view('family-page-children', ['family' => $record]) ?>
33        <?= view('family-page-parents', ['family' => $record]) ?>
34    </div>
35
36    <h3 class="mt-4"><?= I18N::translate('Facts and events') ?></h3>
37    <table class="table wt-facts-table">
38        <?php if ($facts->isEmpty()) : ?>
39            <tr>
40                <td colspan="2">
41                    <?= I18N::translate('No facts exist for this family.') ?>
42                </td>
43            </tr>
44        <?php else : ?>
45            <?php foreach ($facts as $fact) : ?>
46                <?= view('fact', ['fact' => $fact, 'record' => $record]) ?>
47            <?php endforeach ?>
48        <?php endif ?>
49
50        <?php if ($record->canEdit()) : ?>
51            <?= view('fact-add-new', ['record' => $record]) ?>
52        <?php endif ?>
53    </table>
54</div>
55
56<?= view('modals/ajax') ?>
57