xref: /webtrees/resources/views/modules/personal_facts/tab.phtml (revision a5068f91b4349f8a5e47576f9dd749d221f61a10)
1<?php
2
3use Fisharebest\Webtrees\Fact;
4use Fisharebest\Webtrees\Functions\FunctionsPrint;
5use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Individual;
8use Illuminate\Support\Collection;
9
10/**
11 * @var bool             $can_edit
12 * @var Collection<Fact> $clipboard_facts
13 * @var Collection<Fact> $facts
14 * @var bool             $has_associate_facts
15 * @var bool             $has_historic_facts
16 * @var bool             $has_relative_facts
17 * @var Individual       $individual
18 */
19
20?>
21
22<div class="wt-tab-facts py-4">
23    <table class="table wt-facts-table">
24        <tbody>
25            <tr>
26                <td colspan="2">
27                    <?php if ($has_associate_facts) : ?>
28                        <label>
29                            <input id="show-associate-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-associate-fact" data-wt-persist="associates">
30                            <?= I18N::translate('Associated events') ?>
31                        </label>
32                    <?php endif ?>
33
34                    <?php if ($has_relative_facts) : ?>
35                        <label>
36                            <input id="show-relatives-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-relation-fact" data-wt-persist="relatives">
37                            <?= I18N::translate('Events of close relatives') ?>
38                        </label>
39                    <?php endif ?>
40
41                    <?php if ($has_historic_facts) : ?>
42                        <label>
43                            <input id="show-historical-facts" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-historic-fact" data-wt-persist="historic-facts">
44                            <?= I18N::translate('Historic events') ?>
45                        </label>
46                    <?php endif ?>
47                </td>
48            </tr>
49
50            <?php foreach ($facts as $fact) : ?>
51                <?php FunctionsPrintFacts::printFact($fact, $individual) ?>
52            <?php endforeach ?>
53
54            <?php if ($facts->isEmpty()) : ?>
55                <tr>
56                    <td colspan="2">
57                        <?= I18N::translate('There are no facts for this individual.') ?>
58                    </td>
59                </tr>
60            <?php endif ?>
61
62            <?php if ($individual->canEdit()) : ?>
63                <?php FunctionsPrint::printAddNewFact($individual) ?>
64            <?php endif ?>
65        </tbody>
66    </table>
67</div>
68