xref: /webtrees/resources/views/note-page-details.phtml (revision e2fd54362e8266a04e38c63bba780ded538db667)
1<?php
2
3use Fisharebest\Webtrees\Auth;
4use Fisharebest\Webtrees\Fact;
5use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
6use Fisharebest\Webtrees\Http\RequestHandlers\EditNotePage;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\Note;
9use Fisharebest\Webtrees\Registry;
10use Illuminate\Support\Collection;
11
12/**
13 * @var Note             $record
14 * @var Collection<Fact> $clipboard_facts
15 * @var string           $text
16 */
17
18?>
19
20<table class="table wt-facts-table">
21    <tr>
22        <th scope="row">
23            <?= I18N::translate('Shared note') ?>
24            <?php if (Auth::isEditor($record->tree())) : ?>
25                <div class="editfacts nowrap">
26                    <a class="btn btn-link" href="<?= e(route(EditNotePage::class, ['xref' => $record->xref(), 'tree' => $record->tree()->name()])) ?>" title="<?= I18N::translate('Edit') ?>">
27                        <?= view('icons/edit') ?>
28                        <span class="sr-only">
29                            <?= I18N::translate('Edit') ?>
30                        </span>
31                    </a>
32                </div>
33            <?php endif ?>
34        </th>
35        <td>
36            <?php if ($record->tree()->getPreference('FORMAT_TEXT') === 'markdown') : ?>
37                <div class="markdown" dir="auto">
38                    <?= Registry::markdownFactory()->markdown($record->tree())->convertToHtml($record->getNote()) ?>
39                </div>
40            <?php else : ?>
41                <div class="markdown" dir="auto" style="white-space: pre-wrap;">
42                    <?= Registry::markdownFactory()->autolink($record->tree())->convertToHtml($record->getNote()) ?>
43                </div>
44            <?php endif ?>
45        </td>
46    </tr>
47
48    <?php foreach ($record->facts() as $fact) : ?>
49        <?php if ($fact->tag() !== 'NOTE:CONT') : ?>
50           <?php FunctionsPrintFacts::printFact($fact, $record) ?>
51    <?php endif ?>
52    <?php endforeach ?>
53</table>
54