xref: /webtrees/resources/views/family-page.phtml (revision 0f5fd22fb1857ad87285e5357592434d47b1f3bf)
117dd427eSGreg Roach<?php
217dd427eSGreg Roach
317dd427eSGreg Roachuse Fisharebest\Webtrees\Auth;
47c2c99faSGreg Roachuse Fisharebest\Webtrees\Fact;
502467d32SGreg Roachuse Fisharebest\Webtrees\Family;
617dd427eSGreg Roachuse Fisharebest\Webtrees\Functions\FunctionsPrint;
717dd427eSGreg Roachuse Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
82917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
917dd427eSGreg Roachuse Fisharebest\Webtrees\I18N;
107c2c99faSGreg Roachuse Illuminate\Support\Collection;
117c2c99faSGreg Roach
127c2c99faSGreg Roach/**
137c2c99faSGreg Roach * @var Collection<Fact> $clipboard_facts
147c2c99faSGreg Roach * @var Collection<Fact> $facts
157c2c99faSGreg Roach * @var Family           $record
167c2c99faSGreg Roach */
1717dd427eSGreg Roach
1817dd427eSGreg Roach?>
19dd6b2bfcSGreg Roach
20*0f5fd22fSGreg Roach<?= view('family-page-pending', ['record' => $record]) ?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<div class="d-flex mb-4">
23dd6b2bfcSGreg Roach    <h2 class="wt-page-title mx-auto">
2439ca88baSGreg Roach        <?= $record->fullName() ?>
25dd6b2bfcSGreg Roach    </h2>
261450f098SGreg Roach    <?php if ($record->canEdit()) : ?>
27*0f5fd22fSGreg Roach        <?= view('family-page-menu', ['clipboard_facts' => $clipboard_facts, 'record' => $record]) ?>
28dd6b2bfcSGreg Roach    <?php endif ?>
29dd6b2bfcSGreg Roach</div>
30dd6b2bfcSGreg Roach
31dd6b2bfcSGreg Roach<div class="wt-page-content">
3217dd427eSGreg Roach    <div class="wt-family-members d-flex">
3317dd427eSGreg Roach        <?= view('family-page-children', ['family' => $record]) ?>
3417dd427eSGreg Roach        <?= view('family-page-parents', ['family' => $record]) ?>
3517dd427eSGreg Roach    </div>
3617dd427eSGreg Roach
3717dd427eSGreg Roach    <h3 class="mt-4"><?= I18N::translate('Facts and events') ?></h3>
38dd6b2bfcSGreg Roach    <table class="table wt-facts-table">
3939ca88baSGreg Roach        <?php if ($facts->isEmpty()) : ?>
40dd6b2bfcSGreg Roach            <tr>
41d224ae93SGreg Roach                <td colspan="2">
42dd6b2bfcSGreg Roach                    <?= I18N::translate('No facts exist for this family.') ?>
43dd6b2bfcSGreg Roach                </td>
44dd6b2bfcSGreg Roach            </tr>
45dd6b2bfcSGreg Roach        <?php else : ?>
46dd6b2bfcSGreg Roach            <?php foreach ($facts as $fact) : ?>
47dd6b2bfcSGreg Roach                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
48dd6b2bfcSGreg Roach            <?php endforeach ?>
49dd6b2bfcSGreg Roach        <?php endif ?>
50dd6b2bfcSGreg Roach
51f4afa648SGreg Roach        <?php if (Auth::isEditor($record->tree())) : ?>
52*0f5fd22fSGreg Roach            <?php FunctionsPrint::printAddNewFact($record) ?>
53dd6b2bfcSGreg Roach            <tr>
54dd6b2bfcSGreg Roach                <th scope="row">
55dd6b2bfcSGreg Roach                    <?= I18N::translate('Note') ?>
56dd6b2bfcSGreg Roach                </th>
57dd6b2bfcSGreg Roach                <td>
582917771cSGreg Roach                    <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'NOTE'])) ?>">
59dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a note') ?>
60dd6b2bfcSGreg Roach                    </a>
61dd6b2bfcSGreg Roach                </td>
62dd6b2bfcSGreg Roach            </tr>
63dd6b2bfcSGreg Roach
64f4afa648SGreg Roach            <?php if ($record->tree()->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($record->tree())) : ?>
65dd6b2bfcSGreg Roach                <tr>
66dd6b2bfcSGreg Roach                    <th scope="row">
67dd6b2bfcSGreg Roach                        <?= I18N::translate('Media object') ?>
68dd6b2bfcSGreg Roach                    </th>
69ac1d7be4SGreg Roach                    <td>
702917771cSGreg Roach                        <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
71dd6b2bfcSGreg Roach                            <?= I18N::translate('Add a media object') ?>
72dd6b2bfcSGreg Roach                        </a>
73dd6b2bfcSGreg Roach                    </td>
74dd6b2bfcSGreg Roach                </tr>
75dd6b2bfcSGreg Roach            <?php endif ?>
76dd6b2bfcSGreg Roach
77dd6b2bfcSGreg Roach            <tr>
78dd6b2bfcSGreg Roach                <th scope="row">
79dd6b2bfcSGreg Roach                    <?= I18N::translate('Source') ?>
80dd6b2bfcSGreg Roach                </th>
81dd6b2bfcSGreg Roach                <td>
822917771cSGreg Roach                    <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SOUR'])) ?>">
83dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a source citation') ?>
84dd6b2bfcSGreg Roach                    </a>
85dd6b2bfcSGreg Roach                </td>
86dd6b2bfcSGreg Roach            </tr>
87dd6b2bfcSGreg Roach        <?php endif ?>
88dd6b2bfcSGreg Roach    </table>
89dd6b2bfcSGreg Roach</div>
90dd6b2bfcSGreg Roach
91dd6b2bfcSGreg Roach<?= view('modals/ajax') ?>
92