xref: /webtrees/resources/views/record-page-menu-clipboard.phtml (revision 7983c436b964749749956115f9a70ba44187bb6a)
1<?php
2
3use Fisharebest\Webtrees\Fact;
4use Fisharebest\Webtrees\GedcomRecord;
5use Fisharebest\Webtrees\Http\RequestHandlers\EmptyClipboard;
6use Fisharebest\Webtrees\Http\RequestHandlers\PasteFact;
7use Fisharebest\Webtrees\I18N;
8use Illuminate\Support\Collection;
9
10/**
11 * @var Collection<Fact> $clipboard_facts
12 * @var GedcomRecord     $record
13 */
14
15?>
16
17<div class="dropdown-header">
18    <?= I18N::translate('Add from clipboard') ?>
19</div>
20
21<?php foreach ($clipboard_facts as $fact) : ?>
22    <form method="post" class="dropdown-item" action="<?= route(PasteFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()]) ?>">
23        <?= csrf_field() ?>
24        <?= view('icons/copy') ?>
25        <input type="hidden" name="fact_id" value="<?= e($fact->id()) ?>">
26        <button type="submit" class="btn btn-text p-0 text-truncate" style="max-width: 12rem;" title="<?= strip_tags($fact->name()) ?>">
27            <?= $fact->name() ?>
28        </button>
29    </form>
30<?php endforeach ?>
31
32<form method="post" class="dropdown-item" action="<?= route(EmptyClipboard::class) ?>">
33    <?= csrf_field() ?>
34    <input type="hidden" value="<?= e($record->url()) ?>">
35    <?= view('icons/delete') ?>
36    <button type="submit" class="btn btn-text p-0">
37        <?= I18N::translate('Empty the clipboard') ?>
38    </button>
39</form>
40