xref: /webtrees/resources/views/individual-page-menu.phtml (revision 2917771c25c65897723561cdcefe19f90d29a925)
15229eadeSGreg Roach<?php
25229eadeSGreg Roach
35229eadeSGreg Roachuse Fisharebest\Webtrees\Auth;
4*2917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
53b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
6*2917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditFact;
73b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
85229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
95229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
105229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderSpousesPage;
115229eadeSGreg Roachuse Fisharebest\Webtrees\I18N;
125229eadeSGreg Roach
135229eadeSGreg Roach?>
14dd6b2bfcSGreg Roach
15dd6b2bfcSGreg Roach<div class="dropdown wt-page-menu">
16dd6b2bfcSGreg 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">
17d993d560SGreg Roach        <?= view('icons/edit') ?>
18dd6b2bfcSGreg Roach        <?= I18N::translate('edit') ?>
19dd6b2bfcSGreg Roach    </button>
2004fe0783SGreg Roach
21dd6b2bfcSGreg Roach    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
229022ab66SGreg Roach        <a class="dropdown-item" href="<?= e(route('add-name', ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
2304fe0783SGreg Roach            <?= view('icons/add') ?>
24dd6b2bfcSGreg Roach            <?= I18N::translate('Add a name') ?>
25dd6b2bfcSGreg Roach        </a>
26dd6b2bfcSGreg Roach
27dd6b2bfcSGreg Roach        <?php if ($count_names > 1) : ?>
285229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderNamesPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
2904fe0783SGreg Roach                <?= view('icons/reorder') ?>
30dd6b2bfcSGreg Roach                <?= I18N::translate('Re-order names') ?>
31dd6b2bfcSGreg Roach            </a>
328e64ca84SGreg Roach        <?php else : ?>
338e64ca84SGreg Roach            <div class="dropdown-item disabled">
348e64ca84SGreg Roach                <?= view('icons/spacer') ?>
358e64ca84SGreg Roach                <?= I18N::translate('Re-order names') ?>
368e64ca84SGreg Roach            </div>
37dd6b2bfcSGreg Roach        <?php endif ?>
38dd6b2bfcSGreg Roach
3904fe0783SGreg Roach        <div class="dropdown-divider"></div>
4004fe0783SGreg Roach
4104fe0783SGreg Roach        <?php if ($count_sex === 0) : ?>
42*2917771cSGreg Roach            <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['fact' => 'SEX', 'tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
4304fe0783SGreg Roach                <?= view('icons/edit') ?>
44dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the gender') ?>
45dd6b2bfcSGreg Roach            </a>
468e64ca84SGreg Roach        <?php endif ?>
478e64ca84SGreg Roach
488e64ca84SGreg Roach        <?php foreach ($individual->facts(['SEX']) as $fact) : ?>
498e64ca84SGreg Roach            <?php if ($fact->canEdit()) : ?>
50*2917771cSGreg Roach                <a class="dropdown-item" href="<?= e(route(EditFact::class, ['xref' => $individual->xref(), 'fact_id' => $fact->id(), 'tree' => $individual->tree()->name()])) ?>">
518e64ca84SGreg Roach                    <?= view('icons/edit') ?>
528e64ca84SGreg Roach                    <?= I18N::translate('Edit the gender') ?>
538e64ca84SGreg Roach                </a>
548e64ca84SGreg Roach            <?php endif ?>
558e64ca84SGreg Roach        <?php endforeach ?>
5604fe0783SGreg Roach
5704fe0783SGreg Roach        <div class="dropdown-divider"></div>
588e64ca84SGreg Roach
5983615acfSGreg Roach        <?php if ($individual->spouseFamilies()->count() > 1) : ?>
605229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderSpousesPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
6183615acfSGreg Roach                <?= view('icons/reorder') ?>
6283615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6383615acfSGreg Roach            </a>
6483615acfSGreg Roach        <?php else : ?>
6583615acfSGreg Roach            <div class="dropdown-item disabled">
6683615acfSGreg Roach                <?= view('icons/spacer') ?>
6783615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6883615acfSGreg Roach            </div>
6983615acfSGreg Roach        <?php endif ?>
7083615acfSGreg Roach
7183615acfSGreg Roach        <div class="dropdown-divider"></div>
7283615acfSGreg Roach
73*2917771cSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'OBJE'])) ?>">
748e64ca84SGreg Roach            <?= view('icons/add') ?>
758e64ca84SGreg Roach            <?= I18N::translate('Add a media object') ?>
768e64ca84SGreg Roach        </a>
778e64ca84SGreg Roach
788e64ca84SGreg Roach        <?php if ($individual->facts(['OBJE'])->count() > 1) : ?>
795229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderMediaPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
80a6c1d617SGreg Roach                <?= view('icons/reorder') ?>
818e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
828e64ca84SGreg Roach            </a>
838e64ca84SGreg Roach        <?php else : ?>
848e64ca84SGreg Roach            <div class="dropdown-item disabled">
858e64ca84SGreg Roach                <?= view('icons/spacer') ?>
868e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
878e64ca84SGreg Roach            </div>
88dd6b2bfcSGreg Roach        <?php endif ?>
89dd6b2bfcSGreg Roach
908e64ca84SGreg Roach        <div class="dropdown-divider"></div>
918e64ca84SGreg Roach
923b3db8adSGreg 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()])) ?>">
9304fe0783SGreg Roach            <?= view('icons/delete') ?>
94dd6b2bfcSGreg Roach            <?= I18N::translate('Delete') ?>
95dd6b2bfcSGreg Roach        </a>
96dd6b2bfcSGreg Roach
97f4afa648SGreg Roach        <?php if (Auth::isAdmin() || $individual->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
983b3db8adSGreg Roach            <a class="dropdown-item" href="<?= e(route(EditRawRecordPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
9904fe0783SGreg Roach                <?= view('icons/edit') ?>
100dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the raw GEDCOM') ?>
101dd6b2bfcSGreg Roach            </a>
102dd6b2bfcSGreg Roach        <?php endif ?>
103dd6b2bfcSGreg Roach    </div>
104dd6b2bfcSGreg Roach</div>
105