xref: /webtrees/resources/views/modules/personal_facts/tab.phtml (revision dae8440ab1203b4eb5e333de33e187c1dfc5b759)
1<?php use Fisharebest\Webtrees\Functions\FunctionsPrint; ?>
2<?php use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; ?>
3<?php use Fisharebest\Webtrees\I18N; ?>
4<?php use Fisharebest\Webtrees\View; ?>
5
6<div class="wt-facts-tab py-4">
7    <table class="table wt-facts-table">
8        <tbody>
9            <tr>
10                <td colspan="2">
11                    <label>
12                        <input id="show-relatives-facts" type="checkbox" data-toggle="collapse" data-target=".wt-relation-fact">
13                        <?= I18N::translate('Events of close relatives') ?>
14                    </label>
15                    <?php if ($has_historical_facts) : ?>
16                        <label>
17                            <input id="show-historical-facts" type="checkbox" data-toggle="collapse" data-target=".wt-historic-fact">
18                            <?= I18N::translate('Historical facts') ?>
19                        </label>
20                    <?php endif ?>
21                </td>
22            </tr>
23
24            <?php foreach ($facts as $fact) : ?>
25                <?php FunctionsPrintFacts::printFact($fact, $individual) ?>
26            <?php endforeach ?>
27
28            <?php if (empty($facts)) : ?>
29                <tr>
30                    <td colspan="2">
31                        <?= I18N::translate('There are no facts for this individual.') ?>
32                    </td>
33                </tr>
34            <?php endif ?>
35
36            <?php if ($individual->canEdit()) : ?>
37                <?php FunctionsPrint::printAddNewFact($individual, $facts, 'INDI') ?>
38            <?php endif ?>
39        </tbody>
40    </table>
41</div>
42
43<?php View::push('javascript') ?>
44<script>
45  'use strict';
46
47  persistent_toggle('show-relatives-facts');
48  persistent_toggle('show-historical-facts');
49</script>
50<?php View::endpush() ?>
51