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