xref: /webtrees/resources/views/edit/icon-fact-delete.phtml (revision 36de22acf6348b1059dac63e3cd19589574906ac)
1<?php
2
3use Fisharebest\Webtrees\Fact;
4use Fisharebest\Webtrees\Http\RequestHandlers\DeleteFact;
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var Fact $fact
9 */
10
11?>
12
13<?php if ($fact->target() === null): ?>
14    <a class="btn btn-link btn-sm" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($fact->summary())) ?>" data-post-url="<?= e(route(DeleteFact::class, ['tree' => $fact->record()->tree()->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" title="<?= I18N::translate('Delete') ?>">
15        <?= view('icons/delete') ?>
16        <span class="sr-only"><?= I18N::translate('Delete') ?></span>
17    </a>
18<?php else: ?>
19    <a class="btn btn-link btn-sm" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete the link to “%s”?', strip_tags($fact->target()->fullName())) ?>" data-post-url="<?= e(route(DeleteFact::class, ['tree' => $fact->record()->tree()->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" title="<?= I18N::translate('Unlink') ?>">
20        <?= view('icons/delete') ?>
21        <span class="sr-only"><?= I18N::translate('Unlink') ?></span>
22    </a>
23<?php endif ?>
24