xref: /webtrees/resources/views/modules/notes/tab.phtml (revision d812eb6b3dd6c33a96d07cd964cb4c3b88cec447)
1<?php use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3<?php use Fisharebest\Webtrees\View; ?>
4
5<div class="wt-tan-notes 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" data-toggle="collapse" data-target=".wt-level-two-note">
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            <?= view('edit/paste-fact-row', ['record' => $individual, 'facts' => $clipboard_facts]) ?>
33
34            <tr>
35                <th scope="row">
36                    <?= I18N::translate('Note') ?>
37                </th>
38                <td>
39                    <a href="<?= e(route('add-fact', ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'NOTE'])) ?>">
40                        <?= I18N::translate('Add a note') ?>
41                    </a>
42                </td>
43            </tr>
44            <tr>
45                <th scope="row">
46                    <?= I18N::translate('Shared note') ?>
47                </th>
48                <td>
49                    <a href="<?= e(route('add-fact', ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'SHARED_NOTE'])) ?>">
50                        <?= I18N::translate('Add a shared note') ?>
51                    </a>
52                </td>
53            </tr>
54        <?php endif ?>
55    </table>
56</div>
57
58<?php View::push('javascript') ?>
59<script>
60  'use strict';
61
62  persistent_toggle("show-level-2-notes");
63</script>
64<?php View::endpush() ?>
65