xref: /webtrees/resources/views/family-page-menu.phtml (revision 1f1ffa65b3b51df2b95b5c68894525436855964a)
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        <a class="dropdown-item menu-fam-change" href="<?= e(route('change-family-members', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
11            <?= I18N::translate('Change family members') ?>
12        </a>
13
14        <?php if ($record->husband() === null): ?>
15            <a class="dropdown-item menu-fam-addchil" href="<?= e(route('add-spouse-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'HUSB'])) ?>">
16                <?= I18N::translate('Add a husband') ?>
17            </a>
18        <?php endif ?>
19
20        <?php if ($record->wife() === null): ?>
21            <a class="dropdown-item menu-fam-addchil" href="<?= e(route('add-spouse-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'WIFE'])) ?>">
22                <?= I18N::translate('Add a wife') ?>
23            </a>
24        <?php endif ?>
25
26        <a class="dropdown-item menu-fam-addchil" href="<?= e(route('add-child-to-family', ['gender' => 'U', 'ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
27            <?= I18N::translate('Add a child') ?>
28        </a>
29
30        <?php if ($record->numberOfChildren() > 1) : ?>
31            <a class="dropdown-item menu-fam-orderchil" href="<?= e(route('reorder-children', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
32                <?= I18N::translate('Re-order children') ?>
33            </a>
34        <?php endif ?>
35
36        <div class="dropdown-divider"></div>
37
38        <a class="dropdown-item menu-fam-del" href="#" data-confirm="<?= I18N::translate('Deleting the family will unlink all of the individuals from each other but will leave the individuals in place. Are you sure you want to delete this family?') ?>" onclick="return confirm(this.dataset.confirm) && delete_record('<?= e($record->xref()) ?>', '<?= e($record->tree()->name()) ?>');">
39            <?= I18N::translate('Delete') ?>
40        </a>
41
42        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
43            <div class="dropdown-divider"></div>
44
45            <a class="dropdown-item menu-fam-editraw" href="<?= e(route('edit-raw-record', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
46                <?= I18N::translate('Edit the raw GEDCOM') ?>
47            </a>
48        <?php endif ?>
49    </div>
50</div>
51