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