xref: /webtrees/resources/views/modules/personal_facts/tab.phtml (revision 8ec20abd79c212e7a7eb551d7b7b258fce55abb3)
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-tab-facts 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 ($facts->isEmpty()) : ?>
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                <?= view('edit/paste-fact-row', ['record' => $individual, 'facts' => $clipboard_facts]) ?>
38
39                <?php FunctionsPrint::printAddNewFact($individual, $facts, 'INDI') ?>
40            <?php endif ?>
41        </tbody>
42    </table>
43</div>
44
45<?php View::push('javascript') ?>
46<script>
47  'use strict';
48
49  persistent_toggle('show-relatives-facts');
50  persistent_toggle('show-historical-facts');
51</script>
52<?php View::endpush() ?>
53