xref: /webtrees/resources/views/family-page.phtml (revision 3d9e70a53ebdea3db408ada1769711840cc7d14c)
1<?php
2
3use Fisharebest\Webtrees\Auth;
4use Fisharebest\Webtrees\Fact;
5use Fisharebest\Webtrees\Family;
6use Fisharebest\Webtrees\Functions\FunctionsPrint;
7use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
8use Fisharebest\Webtrees\I18N;
9use Illuminate\Support\Collection;
10
11/**
12 * @var Collection<Fact> $clipboard_facts
13 * @var Collection<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', ['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                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
47            <?php endforeach ?>
48        <?php endif ?>
49
50        <?php if (Auth::isEditor($record->tree())) : ?>
51            <?php FunctionsPrint::printAddNewFact($record) ?>
52        <?php endif ?>
53    </table>
54</div>
55
56<?= view('modals/ajax') ?>
57