xref: /webtrees/resources/views/individual-page-menu.phtml (revision d993d560f991544b8dc49e013a8027c6fc967956)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3
4<div class="dropdown wt-page-menu">
5    <button class="btn btn-primary dropdown-toggle wt-page-menu-button" type="button" id="page-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
6        <?= view('icons/edit') ?>
7        <?= I18N::translate('edit') ?>
8    </button>
9    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
10        <?php if ($count_sex === 0) : ?>
11            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-fact', ['fact' => 'SEX', 'ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
12                <?= I18N::translate('Edit the gender') ?>
13            </a>
14
15        <?php endif ?>
16
17        <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-name', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
18            <?= I18N::translate('Add a name') ?>
19        </a>
20
21        <?php if ($count_names > 1) : ?>
22            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('reorder-names', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
23                <?= I18N::translate('Re-order names') ?>
24            </a>
25        <?php endif ?>
26
27        <?php if (empty($individual->facts(['SEX']))) : ?>
28            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-fact', ['fact' => 'SEX', 'ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
29                <?= I18N::translate('Edit the gender') ?>
30            </a>
31        <?php endif ?>
32
33
34        <a class="dropdown-item menu-indi-del" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($individual->getFullName())) ?>" onclick="return confirm(this.dataset.confirm) && delete_record('<?= e($individual->xref()) ?>', '<?= e($individual->tree()->name()) ?>');">
35            <?= I18N::translate('Delete') ?>
36        </a>
37
38        <?php if (Auth::isAdmin() || $individual->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
39            <div class="dropdown-divider"></div>
40
41            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('edit-raw-record', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
42                <?= I18N::translate('Edit the raw GEDCOM') ?>
43            </a>
44        <?php endif ?>
45    </div>
46</div>
47