xref: /webtrees/resources/views/edit/icon-fact-delete.phtml (revision ad5dbf3760bf7e9d443f0c36750aa2af1d6adae8)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Fact;
6use Fisharebest\Webtrees\Http\RequestHandlers\DeleteFact;
7use Fisharebest\Webtrees\I18N;
8
9/**
10 * @var Fact $fact
11 */
12
13?>
14
15<?php if ($fact->target() === null) : ?>
16    <a class="btn btn-link btn-sm" href="#" data-wt-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($fact->name())) ?>" 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') ?>">
17        <?= view('icons/delete') ?>
18        <span class="visually-hidden"><?= I18N::translate('Delete') ?></span>
19    </a>
20<?php else : ?>
21    <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') ?>">
22        <?= view('icons/delete') ?>
23        <span class="visually-hidden"><?= I18N::translate('Unlink') ?></span>
24    </a>
25<?php endif ?>
26