xref: /webtrees/resources/views/modules/notes/tab.phtml (revision 4a2590a502a224163349fa10c461f39070abb3bc)
1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; ?>
2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
3dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\View; ?>
4dd6b2bfcSGreg Roach
5*4a2590a5SGreg Roach<div class="wt-tan-notes py-4">
6dd6b2bfcSGreg Roach    <table class="table wt-facts-table">
7dd6b2bfcSGreg Roach        <tr>
8dd6b2bfcSGreg Roach            <td colspan="2">
9dd6b2bfcSGreg Roach                <label>
1064490ee2SGreg Roach                    <input id="show-level-2-notes" type="checkbox" data-toggle="collapse" data-target=".wt-level-two-note">
11dd6b2bfcSGreg Roach                    <?= I18N::translate('Show all notes') ?>
12dd6b2bfcSGreg Roach                </label>
13dd6b2bfcSGreg Roach            </td>
14dd6b2bfcSGreg Roach        </tr>
15dd6b2bfcSGreg Roach
16dd6b2bfcSGreg Roach        <?php foreach ($facts as $fact) : ?>
17dd6b2bfcSGreg Roach            <?php FunctionsPrintFacts::printMainNotes($fact, 1) ?>
18dd6b2bfcSGreg Roach            <?php FunctionsPrintFacts::printMainNotes($fact, 2) ?>
19dd6b2bfcSGreg Roach            <?php FunctionsPrintFacts::printMainNotes($fact, 3) ?>
20dd6b2bfcSGreg Roach            <?php FunctionsPrintFacts::printMainNotes($fact, 4) ?>
21dd6b2bfcSGreg Roach        <?php endforeach ?>
22dd6b2bfcSGreg Roach
23dd6b2bfcSGreg Roach        <?php if (empty($facts)) : ?>
24dd6b2bfcSGreg Roach            <tr>
25dd6b2bfcSGreg Roach                <td colspan="2">
26dd6b2bfcSGreg Roach                    <?= I18N::translate('There are no notes for this individual.') ?>
27dd6b2bfcSGreg Roach                </td>
28dd6b2bfcSGreg Roach            </tr>
29dd6b2bfcSGreg Roach        <?php endif ?>
30dd6b2bfcSGreg Roach
31dd6b2bfcSGreg Roach        <?php if ($can_edit) : ?>
322adcbd9aSGreg Roach            <?= view('edit/paste-fact-row', ['record' => $individual, 'facts' => $clipboard_facts]) ?>
332adcbd9aSGreg Roach
34dd6b2bfcSGreg Roach            <tr>
35dd6b2bfcSGreg Roach                <th scope="row">
36dd6b2bfcSGreg Roach                    <?= I18N::translate('Note') ?>
37dd6b2bfcSGreg Roach                </th>
38dd6b2bfcSGreg Roach                <td>
39f4afa648SGreg Roach                    <a href="<?= e(route('add-fact', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'NOTE'])) ?>">
40dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a note') ?>
41dd6b2bfcSGreg Roach                    </a>
42dd6b2bfcSGreg Roach                </td>
43dd6b2bfcSGreg Roach            </tr>
44dd6b2bfcSGreg Roach            <tr>
45dd6b2bfcSGreg Roach                <th scope="row">
46dd6b2bfcSGreg Roach                    <?= I18N::translate('Shared note') ?>
47dd6b2bfcSGreg Roach                </th>
48dd6b2bfcSGreg Roach                <td>
49f4afa648SGreg Roach                    <a href="<?= e(route('add-fact', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'SHARED_NOTE'])) ?>">
50dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a shared note') ?>
51dd6b2bfcSGreg Roach                    </a>
52dd6b2bfcSGreg Roach                </td>
53dd6b2bfcSGreg Roach            </tr>
54dd6b2bfcSGreg Roach        <?php endif ?>
55dd6b2bfcSGreg Roach    </table>
56dd6b2bfcSGreg Roach</div>
57dd6b2bfcSGreg Roach
58dd6b2bfcSGreg Roach<?php View::push('javascript') ?>
59dd6b2bfcSGreg Roach<script>
60dd6b2bfcSGreg Roach  'use strict';
61dd6b2bfcSGreg Roach
6264490ee2SGreg Roach  persistent_toggle("show-level-2-notes");
63dd6b2bfcSGreg Roach</script>
64dd6b2bfcSGreg Roach<?php View::endpush() ?>
65