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