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