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