xref: /webtrees/resources/views/edit/icon-fact-delete.phtml (revision d9efec4aaa9aefd6a527c75c15e437b9a1a6604c)
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-wt-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($fact->summary())) ?>" data-wt-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="visually-hidden"><?= I18N::translate('Delete') ?></span>
17    </a>
18<?php else: ?>
19    <a class="btn btn-link btn-sm" href="#" data-wt-confirm="<?= I18N::translate('Are you sure you want to delete the link to “%s”?', strip_tags($fact->target()->fullName())) ?>" data-wt-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="visually-hidden"><?= I18N::translate('Unlink') ?></span>
22    </a>
23<?php endif ?>
24