summaryrefslogtreecommitdiff
path: root/resources/views/modules/notes/tab.phtml
blob: 9dde4dc81e8b4ffbfa0c0b69ac73c6dce487f0b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php

use Fisharebest\Webtrees\Fact;
use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
use Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Illuminate\Support\Collection;

/**
 * @var bool             $can_edit
 * @var Collection<Fact> $clipboard_facts
 * @var Collection<Fact> $facts
 * @var Individual       $individual
 */

?>

<div class="wt-tan-notes py-4">
    <table class="table wt-facts-table">
        <tr>
            <td colspan="2">
                <label>
                    <input id="show-level-2-notes" type="checkbox" data-bs-toggle="collapse" data-bs-target=".wt-level-two-note" data-wt-persist="level-two-notes">
                    <?= I18N::translate('Show all notes') ?>
                </label>
            </td>
        </tr>

        <?php foreach ($facts as $fact) : ?>
            <?php FunctionsPrintFacts::printMainNotes($fact, 1) ?>
            <?php FunctionsPrintFacts::printMainNotes($fact, 2) ?>
            <?php FunctionsPrintFacts::printMainNotes($fact, 3) ?>
            <?php FunctionsPrintFacts::printMainNotes($fact, 4) ?>
        <?php endforeach ?>

        <?php if ($facts->isEmpty()) : ?>
            <tr>
                <td colspan="2">
                    <?= I18N::translate('There are no notes for this individual.') ?>
                </td>
            </tr>
        <?php endif ?>

        <?php if ($can_edit) : ?>
            <tr>
                <th scope="row">
                    <?= I18N::translate('Note') ?>
                </th>
                <td>
                    <a href="<?= e(route(AddNewFact::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'NOTE'])) ?>">
                        <?= I18N::translate('Add a note') ?>
                    </a>
                </td>
            </tr>
        <?php endif ?>
    </table>
</div>