xref: /webtrees/resources/views/record-page-menu-clipboard.phtml (revision 58c781b3c055e42036269e115fb5a3c4643b0df4)
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<int,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        <?= view('icons/copy') ?>
24
25        <input type="hidden" name="fact_id" value="<?= e($fact->id()) ?>">
26
27        <button type="submit" class="btn btn-text p-0 text-truncate" style="max-width: 12rem;" title="<?= strip_tags($fact->name()) ?>">
28            <?= $fact->name() ?>
29        </button>
30
31        <?= csrf_field() ?>
32    </form>
33<?php endforeach ?>
34
35<form method="post" class="dropdown-item" action="<?= route(EmptyClipboard::class) ?>">
36    <input type="hidden" value="<?= e($record->url()) ?>">
37
38    <?= view('icons/delete') ?>
39
40    <button type="submit" class="btn btn-text p-0">
41        <?= I18N::translate('Empty the clipboard') ?>
42    </button>
43
44    <?= csrf_field() ?>
45</form>
46