xref: /webtrees/resources/views/individual-page-menu.phtml (revision a53fee79c403375acbf47400b853e791c1b58d92)
15229eadeSGreg Roach<?php
25229eadeSGreg Roach
35229eadeSGreg Roachuse Fisharebest\Webtrees\Auth;
47c7d1e03SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddName;
52917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
63b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
7*a53fee79SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
83b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
95229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
105229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
111afbbc50SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderFamiliesPage;
125229eadeSGreg Roachuse Fisharebest\Webtrees\I18N;
135229eadeSGreg Roach
145229eadeSGreg Roach?>
15dd6b2bfcSGreg Roach
16dd6b2bfcSGreg Roach<div class="dropdown wt-page-menu">
17dd6b2bfcSGreg Roach    <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">
18d993d560SGreg Roach        <?= view('icons/edit') ?>
19dd6b2bfcSGreg Roach        <?= I18N::translate('edit') ?>
20dd6b2bfcSGreg Roach    </button>
2104fe0783SGreg Roach
22dd6b2bfcSGreg Roach    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
237c7d1e03SGreg Roach        <a class="dropdown-item" href="<?= e(route(AddName::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
2404fe0783SGreg Roach            <?= view('icons/add') ?>
25dd6b2bfcSGreg Roach            <?= I18N::translate('Add a name') ?>
26dd6b2bfcSGreg Roach        </a>
27dd6b2bfcSGreg Roach
287bb122d6SGreg Roach        <?php if ($individual->facts(['NAME'], false, null, true)->count() > 1) : ?>
295229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderNamesPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
3004fe0783SGreg Roach                <?= view('icons/reorder') ?>
31dd6b2bfcSGreg Roach                <?= I18N::translate('Re-order names') ?>
32dd6b2bfcSGreg Roach            </a>
338e64ca84SGreg Roach        <?php else : ?>
348e64ca84SGreg Roach            <div class="dropdown-item disabled">
358e64ca84SGreg Roach                <?= view('icons/spacer') ?>
368e64ca84SGreg Roach                <?= I18N::translate('Re-order names') ?>
378e64ca84SGreg Roach            </div>
38dd6b2bfcSGreg Roach        <?php endif ?>
39dd6b2bfcSGreg Roach
4004fe0783SGreg Roach        <div class="dropdown-divider"></div>
4104fe0783SGreg Roach
427bb122d6SGreg Roach        <?php if ($individual->facts(['SEX'], false, null, true)->isEmpty()) : ?>
432917771cSGreg Roach            <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['fact' => 'SEX', 'tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
4404fe0783SGreg Roach                <?= view('icons/edit') ?>
45dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the gender') ?>
46dd6b2bfcSGreg Roach            </a>
478e64ca84SGreg Roach        <?php endif ?>
488e64ca84SGreg Roach
497bb122d6SGreg Roach        <?php foreach ($individual->facts(['SEX'], false, null, true) as $fact) : ?>
508e64ca84SGreg Roach            <?php if ($fact->canEdit()) : ?>
51*a53fee79SGreg Roach                <a class="dropdown-item" href="<?= e(route(EditFactPage::class, ['xref' => $individual->xref(), 'fact_id' => $fact->id(), 'tree' => $individual->tree()->name()])) ?>">
528e64ca84SGreg Roach                    <?= view('icons/edit') ?>
538e64ca84SGreg Roach                    <?= I18N::translate('Edit the gender') ?>
548e64ca84SGreg Roach                </a>
558e64ca84SGreg Roach            <?php endif ?>
568e64ca84SGreg Roach        <?php endforeach ?>
5704fe0783SGreg Roach
5804fe0783SGreg Roach        <div class="dropdown-divider"></div>
598e64ca84SGreg Roach
60c724a623SGreg Roach        <?php if ($individual->spouseFamilies()->count() > 1 || $individual->childFamilies()->count() > 1) : ?>
611afbbc50SGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderFamiliesPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
6283615acfSGreg Roach                <?= view('icons/reorder') ?>
6383615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6483615acfSGreg Roach            </a>
6583615acfSGreg Roach        <?php else : ?>
6683615acfSGreg Roach            <div class="dropdown-item disabled">
6783615acfSGreg Roach                <?= view('icons/spacer') ?>
6883615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6983615acfSGreg Roach            </div>
7083615acfSGreg Roach        <?php endif ?>
7183615acfSGreg Roach
7283615acfSGreg Roach        <div class="dropdown-divider"></div>
7383615acfSGreg Roach
742917771cSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'OBJE'])) ?>">
758e64ca84SGreg Roach            <?= view('icons/add') ?>
768e64ca84SGreg Roach            <?= I18N::translate('Add a media object') ?>
778e64ca84SGreg Roach        </a>
788e64ca84SGreg Roach
797bb122d6SGreg Roach        <?php if ($individual->facts(['OBJE'], false, null, true)->count() > 1) : ?>
805229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderMediaPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
81a6c1d617SGreg Roach                <?= view('icons/reorder') ?>
828e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
838e64ca84SGreg Roach            </a>
848e64ca84SGreg Roach        <?php else : ?>
858e64ca84SGreg Roach            <div class="dropdown-item disabled">
868e64ca84SGreg Roach                <?= view('icons/spacer') ?>
878e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
888e64ca84SGreg Roach            </div>
89dd6b2bfcSGreg Roach        <?php endif ?>
90dd6b2bfcSGreg Roach
918e64ca84SGreg Roach        <div class="dropdown-divider"></div>
928e64ca84SGreg Roach
933b3db8adSGreg Roach        <a class="dropdown-item" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($individual->fullName())) ?>" data-post-url="<?= e(route(DeleteRecord::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
9404fe0783SGreg Roach            <?= view('icons/delete') ?>
95dd6b2bfcSGreg Roach            <?= I18N::translate('Delete') ?>
96dd6b2bfcSGreg Roach        </a>
97dd6b2bfcSGreg Roach
98f4afa648SGreg Roach        <?php if (Auth::isAdmin() || $individual->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
993b3db8adSGreg Roach            <a class="dropdown-item" href="<?= e(route(EditRawRecordPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
10004fe0783SGreg Roach                <?= view('icons/edit') ?>
101dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the raw GEDCOM') ?>
102dd6b2bfcSGreg Roach            </a>
103dd6b2bfcSGreg Roach        <?php endif ?>
104dd6b2bfcSGreg Roach    </div>
105dd6b2bfcSGreg Roach</div>
106