xref: /webtrees/resources/views/individual-page-menu.phtml (revision 389266c09abfff6214aea2ef212036f49977020e)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\FontAwesome; ?>
3<?php use Fisharebest\Webtrees\I18N; ?>
4
5<div class="dropdown wt-page-menu">
6    <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">
7        <?= FontAwesome::decorativeIcon('edit') ?>
8        <?= I18N::translate('edit') ?>
9    </button>
10    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
11        <?php if ($count_sex === 0) : ?>
12            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-fact', ['fact' => 'SEX', 'ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
13                <?= I18N::translate('Edit the gender') ?>
14            </a>
15
16        <?php endif ?>
17
18        <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-name', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
19            <?= I18N::translate('Add a name') ?>
20        </a>
21
22        <?php if ($count_names > 1) : ?>
23            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('reorder-names', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
24                <?= I18N::translate('Re-order names') ?>
25            </a>
26        <?php endif ?>
27
28        <?php if (empty($individual->facts(['SEX']))) : ?>
29            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('add-fact', ['fact' => 'SEX', 'ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
30                <?= I18N::translate('Edit the gender') ?>
31            </a>
32        <?php endif ?>
33
34
35        <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()) ?>');">
36            <?= I18N::translate('Delete') ?>
37        </a>
38
39        <?php if (Auth::isAdmin() || $individual->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
40            <div class="dropdown-divider"></div>
41
42            <a class="dropdown-item menu-indi-editraw" href="<?= e(route('edit-raw-record', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
43                <?= I18N::translate('Edit the raw GEDCOM') ?>
44            </a>
45        <?php endif ?>
46    </div>
47</div>
48