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