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