xref: /webtrees/resources/views/family-page.phtml (revision 08f0fd1c4b712981efe9f00f3c0143314973411c)
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 bool             $can_upload_media
13 * @var Collection<Fact> $clipboard_facts
14 * @var Collection<Fact> $facts
15 * @var Family           $record
16 */
17
18?>
19
20<?= view('family-page-pending', ['record' => $record]) ?>
21
22<div class="d-flex mb-4">
23    <h2 class="wt-page-title mx-auto">
24        <?= $record->fullName() ?>
25    </h2>
26    <?php if ($record->canEdit()) : ?>
27        <?= view('family-page-menu', ['can_upload_media' => $can_upload_media, 'clipboard_facts' => $clipboard_facts, 'record' => $record]) ?>
28    <?php endif ?>
29</div>
30
31<div class="wt-page-content">
32    <div class="wt-family-members d-flex">
33        <?= view('family-page-children', ['family' => $record]) ?>
34        <?= view('family-page-parents', ['family' => $record]) ?>
35    </div>
36
37    <h3 class="mt-4"><?= I18N::translate('Facts and events') ?></h3>
38    <table class="table wt-facts-table">
39        <?php if ($facts->isEmpty()) : ?>
40            <tr>
41                <td colspan="2">
42                    <?= I18N::translate('No facts exist for this family.') ?>
43                </td>
44            </tr>
45        <?php else : ?>
46            <?php foreach ($facts as $fact) : ?>
47                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
48            <?php endforeach ?>
49        <?php endif ?>
50
51        <?php if (Auth::isEditor($record->tree())) : ?>
52            <?php FunctionsPrint::printAddNewFact($record) ?>
53        <?php endif ?>
54    </table>
55</div>
56
57<?= view('modals/ajax') ?>
58