xref: /webtrees/resources/views/modules/personal_facts/tab.phtml (revision 4e54fb47ea2fc584c07c0c135853d49a85735c1a)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
310e06497SGreg Roachdeclare(strict_types=1);
410e06497SGreg Roach
57c2c99faSGreg Roachuse Fisharebest\Webtrees\Fact;
602467d32SGreg Roachuse Fisharebest\Webtrees\I18N;
702467d32SGreg Roachuse Fisharebest\Webtrees\Individual;
87c2c99faSGreg Roachuse Illuminate\Support\Collection;
97c2c99faSGreg Roach
107c2c99faSGreg Roach/**
117c2c99faSGreg Roach * @var bool                 $can_edit
1236779af1SGreg Roach * @var Collection<int,Fact> $clipboard_facts
1336779af1SGreg Roach * @var Collection<int,Fact> $facts
1491a257a4SGreg Roach * @var bool                 $has_associate_facts
1591a257a4SGreg Roach * @var bool                 $has_historic_facts
1691a257a4SGreg Roach * @var bool                 $has_relative_facts
177c2c99faSGreg Roach * @var Individual           $individual
187c2c99faSGreg Roach */
19d70512abSGreg Roach
20d70512abSGreg Roach?>
21dd6b2bfcSGreg Roach
22*4e54fb47SGreg Roach<div class="wt-tab-facts">
233340ecd2SGreg Roach    <table class="table wt-facts-table" style="table-layout: fixed">
243340ecd2SGreg Roach        <colgroup>
253340ecd2SGreg Roach            <col style="width:25%">
263340ecd2SGreg Roach            <col style="width:75%">
273340ecd2SGreg Roach        </colgroup>
28dd6b2bfcSGreg Roach        <tbody>
29dd6b2bfcSGreg Roach            <tr>
30dd6b2bfcSGreg Roach                <td colspan="2">
3191a257a4SGreg Roach                    <?php if ($has_associate_facts) : ?>
3291a257a4SGreg Roach                        <label>
330363a7fdSDavid Drury                            <input id="show-associate-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-associate-fact" data-wt-persist="associates" autocomplete="off">
3491a257a4SGreg Roach                            <?= I18N::translate('Associated events') ?>
3591a257a4SGreg Roach                        </label>
3691a257a4SGreg Roach                    <?php endif ?>
3791a257a4SGreg Roach
3891a257a4SGreg Roach                    <?php if ($has_relative_facts) : ?>
39dd6b2bfcSGreg Roach                        <label>
400363a7fdSDavid Drury                            <input id="show-relatives-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-relation-fact" data-wt-persist="relatives" autocomplete="off">
41dd6b2bfcSGreg Roach                            <?= I18N::translate('Events of close relatives') ?>
42dd6b2bfcSGreg Roach                        </label>
4391a257a4SGreg Roach                    <?php endif ?>
4491a257a4SGreg Roach
4591a257a4SGreg Roach                    <?php if ($has_historic_facts) : ?>
46dd6b2bfcSGreg Roach                        <label>
470363a7fdSDavid Drury                            <input id="show-historical-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-historic-fact" data-wt-persist="historic-facts" autocomplete="off">
48051c822dSGreg Roach                            <?= I18N::translate('Historic events') ?>
49dd6b2bfcSGreg Roach                        </label>
50dd6b2bfcSGreg Roach                    <?php endif ?>
51dd6b2bfcSGreg Roach                </td>
52dd6b2bfcSGreg Roach            </tr>
53dd6b2bfcSGreg Roach
54dd6b2bfcSGreg Roach            <?php foreach ($facts as $fact) : ?>
55b315f3e1SGreg Roach                <?= view('fact', ['fact' => $fact, 'record' => $individual]) ?>
56dd6b2bfcSGreg Roach            <?php endforeach ?>
57dd6b2bfcSGreg Roach
5839ca88baSGreg Roach            <?php if ($facts->isEmpty()) : ?>
59dd6b2bfcSGreg Roach                <tr>
60dd6b2bfcSGreg Roach                    <td colspan="2">
61dd6b2bfcSGreg Roach                        <?= I18N::translate('There are no facts for this individual.') ?>
62dd6b2bfcSGreg Roach                    </td>
63dd6b2bfcSGreg Roach                </tr>
64dd6b2bfcSGreg Roach            <?php endif ?>
65dd6b2bfcSGreg Roach
66dd6b2bfcSGreg Roach            <?php if ($individual->canEdit()) : ?>
67b315f3e1SGreg Roach                <?= view('fact-add-new', ['record' => $individual]) ?>
68dd6b2bfcSGreg Roach            <?php endif ?>
69dd6b2bfcSGreg Roach        </tbody>
70dd6b2bfcSGreg Roach    </table>
71dd6b2bfcSGreg Roach</div>
72