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