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