xref: /webtrees/resources/views/note-page-details.phtml (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Auth;
6use Fisharebest\Webtrees\Fact;
7use Fisharebest\Webtrees\Http\RequestHandlers\EditNotePage;
8use Fisharebest\Webtrees\I18N;
9use Fisharebest\Webtrees\Note;
10use Fisharebest\Webtrees\Registry;
11use Illuminate\Support\Collection;
12
13/**
14 * @var Note                 $record
15 * @var Collection<int,Fact> $clipboard_facts
16 * @var string               $text
17 */
18
19?>
20
21<table class="table wt-facts-table">
22    <tr>
23        <th scope="row">
24            <?= I18N::translate('Shared note') ?>
25            <?php if (Auth::isEditor($record->tree())) : ?>
26                <div class="pt-2 wt-fact-edit-links">
27                    <a class="btn btn-link" href="<?= e(route(EditNotePage::class, ['xref' => $record->xref(), 'tree' => $record->tree()->name()])) ?>" title="<?= I18N::translate('Edit') ?>">
28                        <?= view('icons/edit') ?>
29                        <span class="visually-hidden">
30                            <?= I18N::translate('Edit') ?>
31                        </span>
32                    </a>
33                </div>
34            <?php endif ?>
35        </th>
36        <td>
37          <?= Registry::elementFactory()->make('NOTE:CONC')->value($record->getNote(), $record->tree()) ?>
38        </td>
39    </tr>
40
41    <?php foreach ($record->facts() as $fact) : ?>
42        <?php if ($fact->tag() !== 'NOTE:CONT') : ?>
43            <?= view('fact', ['fact' => $fact, 'record' => $record]) ?>
44        <?php endif ?>
45    <?php endforeach ?>
46</table>
47