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