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