xref: /webtrees/resources/views/family-page-menu.phtml (revision 0b4092ed8e31e3588eb143d0ade6c4a411367da8)
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
10    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
11        <a class="dropdown-item" href="<?= e(route('change-family-members', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
12            <?= view('icons/family') ?>
13            <?= I18N::translate('Change family members') ?>
14        </a>
15
16        <?php if ($record->husband() === null): ?>
17            <a class="dropdown-item" href="<?= e(route('add-spouse-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'HUSB'])) ?>">
18                <?= view('icons/add') ?>
19                <?= I18N::translate('Add a husband') ?>
20            </a>
21        <?php endif ?>
22
23        <?php if ($record->wife() === null): ?>
24            <a class="dropdown-item" href="<?= e(route('add-spouse-to-family', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'WIFE'])) ?>">
25                <?= view('icons/add') ?>
26                <?= I18N::translate('Add a wife') ?>
27            </a>
28        <?php endif ?>
29
30        <a class="dropdown-item" href="<?= e(route('add-child-to-family', ['gender' => 'U', 'ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
31            <?= view('icons/add') ?>
32            <?= I18N::translate('Add a child') ?>
33        </a>
34
35        <?php if ($record->numberOfChildren() > 1) : ?>
36            <a class="dropdown-item" href="<?= e(route('reorder-children', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
37                <?= view('icons/reorder') ?>
38                <?= I18N::translate('Re-order children') ?>
39            </a>
40        <?php endif ?>
41
42        <div class="dropdown-divider"></div>
43
44        <a class="dropdown-item" 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()) ?>');">
45            <?= view('icons/delete') ?>
46            <?= I18N::translate('Delete') ?>
47        </a>
48
49        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
50            <a class="dropdown-item" href="<?= e(route('edit-raw-record', ['ged' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
51                <?= view('icons/edit') ?>
52                <?= I18N::translate('Edit the raw GEDCOM') ?>
53            </a>
54        <?php endif ?>
55    </div>
56</div>
57