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