xref: /webtrees/resources/views/record-page-menu-clipboard.phtml (revision 9927f70f86c91b9b1fe6c77b5647841190d87ca9)
10f5fd22fSGreg Roach<?php
20f5fd22fSGreg Roach
30f5fd22fSGreg Roachuse Fisharebest\Webtrees\Fact;
40f5fd22fSGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
5*9927f70fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EmptyClipboard;
60f5fd22fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PasteFact;
70f5fd22fSGreg Roachuse Fisharebest\Webtrees\I18N;
80f5fd22fSGreg Roachuse Illuminate\Support\Collection;
90f5fd22fSGreg Roach
100f5fd22fSGreg Roach/**
110f5fd22fSGreg Roach * @var Collection<Fact> $clipboard_facts
120f5fd22fSGreg Roach * @var GedcomRecord     $record
130f5fd22fSGreg Roach */
140f5fd22fSGreg Roach
150f5fd22fSGreg Roach?>
160f5fd22fSGreg Roach
170f5fd22fSGreg Roach<div class="dropdown-header">
180f5fd22fSGreg Roach    <?= I18N::translate('Add from clipboard') ?>
190f5fd22fSGreg Roach</div>
200f5fd22fSGreg Roach
210f5fd22fSGreg Roach<?php foreach ($clipboard_facts as $fact) : ?>
220f5fd22fSGreg Roach    <form method="post" class="form-inline dropdown-item" action="<?= route(PasteFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()]) ?>">
230f5fd22fSGreg Roach        <?= view('icons/copy') ?>
240f5fd22fSGreg Roach        <input type="hidden" name="fact_id" value="<?= e($fact->id()) ?>">
25*9927f70fSGreg Roach        <button type="submit" class="btn btn-text p-0 text-truncate" style="max-width: 12rem;" title="<?= strip_tags($fact->name()) ?>">
26*9927f70fSGreg Roach            <?= $fact->name() ?>
270f5fd22fSGreg Roach        </button>
280f5fd22fSGreg Roach    </form>
290f5fd22fSGreg Roach<?php endforeach ?>
30*9927f70fSGreg Roach
31*9927f70fSGreg Roach<form method="post" class="form-inline dropdown-item" action="<?= route(EmptyClipboard::class) ?>">
32*9927f70fSGreg Roach    <?= csrf_field() ?>
33*9927f70fSGreg Roach    <input type="hidden" value="<?= e($record->url()) ?>">
34*9927f70fSGreg Roach    <?= view('icons/delete') ?>
35*9927f70fSGreg Roach    <button type="submit" class="btn btn-text p-0">
36*9927f70fSGreg Roach        <?= I18N::translate('Empty the clipboard') ?>
37*9927f70fSGreg Roach    </button>
38*9927f70fSGreg Roach</form>
39