xref: /webtrees/resources/views/individual-page-menu.phtml (revision 3b3db8adf3fd54bb8a196a781da9123905e54adf)
15229eadeSGreg Roach<?php
25229eadeSGreg Roach
35229eadeSGreg Roachuse Fisharebest\Webtrees\Auth;
4*3b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
5*3b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
65229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
75229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
85229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderSpousesPage;
95229eadeSGreg Roachuse Fisharebest\Webtrees\I18N;
105229eadeSGreg Roach
115229eadeSGreg Roach?>
12dd6b2bfcSGreg Roach
13dd6b2bfcSGreg Roach<div class="dropdown wt-page-menu">
14dd6b2bfcSGreg 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">
15d993d560SGreg Roach        <?= view('icons/edit') ?>
16dd6b2bfcSGreg Roach        <?= I18N::translate('edit') ?>
17dd6b2bfcSGreg Roach    </button>
1804fe0783SGreg Roach
19dd6b2bfcSGreg Roach    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
209022ab66SGreg Roach        <a class="dropdown-item" href="<?= e(route('add-name', ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
2104fe0783SGreg Roach            <?= view('icons/add') ?>
22dd6b2bfcSGreg Roach            <?= I18N::translate('Add a name') ?>
23dd6b2bfcSGreg Roach        </a>
24dd6b2bfcSGreg Roach
25dd6b2bfcSGreg Roach        <?php if ($count_names > 1) : ?>
265229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderNamesPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
2704fe0783SGreg Roach                <?= view('icons/reorder') ?>
28dd6b2bfcSGreg Roach                <?= I18N::translate('Re-order names') ?>
29dd6b2bfcSGreg Roach            </a>
308e64ca84SGreg Roach        <?php else : ?>
318e64ca84SGreg Roach            <div class="dropdown-item disabled">
328e64ca84SGreg Roach                <?= view('icons/spacer') ?>
338e64ca84SGreg Roach                <?= I18N::translate('Re-order names') ?>
348e64ca84SGreg Roach            </div>
35dd6b2bfcSGreg Roach        <?php endif ?>
36dd6b2bfcSGreg Roach
3704fe0783SGreg Roach        <div class="dropdown-divider"></div>
3804fe0783SGreg Roach
3904fe0783SGreg Roach        <?php if ($count_sex === 0) : ?>
409022ab66SGreg Roach            <a class="dropdown-item" href="<?= e(route('add-fact', ['fact' => 'SEX', 'tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
4104fe0783SGreg Roach                <?= view('icons/edit') ?>
42dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the gender') ?>
43dd6b2bfcSGreg Roach            </a>
448e64ca84SGreg Roach        <?php endif ?>
458e64ca84SGreg Roach
468e64ca84SGreg Roach        <?php foreach ($individual->facts(['SEX']) as $fact) : ?>
478e64ca84SGreg Roach            <?php if ($fact->canEdit()) : ?>
489022ab66SGreg Roach                <a class="dropdown-item" href="<?= e(route('edit-fact', ['xref' => $individual->xref(), 'fact_id' => $fact->id(), 'tree' => $individual->tree()->name()])) ?>">
498e64ca84SGreg Roach                    <?= view('icons/edit') ?>
508e64ca84SGreg Roach                    <?= I18N::translate('Edit the gender') ?>
518e64ca84SGreg Roach                </a>
528e64ca84SGreg Roach            <?php endif ?>
538e64ca84SGreg Roach        <?php endforeach ?>
5404fe0783SGreg Roach
5504fe0783SGreg Roach        <div class="dropdown-divider"></div>
568e64ca84SGreg Roach
5783615acfSGreg Roach        <?php if ($individual->spouseFamilies()->count() > 1) : ?>
585229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderSpousesPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
5983615acfSGreg Roach                <?= view('icons/reorder') ?>
6083615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6183615acfSGreg Roach            </a>
6283615acfSGreg Roach        <?php else : ?>
6383615acfSGreg Roach            <div class="dropdown-item disabled">
6483615acfSGreg Roach                <?= view('icons/spacer') ?>
6583615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
6683615acfSGreg Roach            </div>
6783615acfSGreg Roach        <?php endif ?>
6883615acfSGreg Roach
6983615acfSGreg Roach        <div class="dropdown-divider"></div>
7083615acfSGreg Roach
719022ab66SGreg Roach        <a class="dropdown-item" href="<?= e(route('add-fact', ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'fact' => 'OBJE'])) ?>">
728e64ca84SGreg Roach            <?= view('icons/add') ?>
738e64ca84SGreg Roach            <?= I18N::translate('Add a media object') ?>
748e64ca84SGreg Roach        </a>
758e64ca84SGreg Roach
768e64ca84SGreg Roach        <?php if ($individual->facts(['OBJE'])->count() > 1) : ?>
775229eadeSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderMediaPage::class, ['tree' => $tree->name(), 'xref' => $individual->xref()])) ?>">
78a6c1d617SGreg Roach                <?= view('icons/reorder') ?>
798e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
808e64ca84SGreg Roach            </a>
818e64ca84SGreg Roach        <?php else : ?>
828e64ca84SGreg Roach            <div class="dropdown-item disabled">
838e64ca84SGreg Roach                <?= view('icons/spacer') ?>
848e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
858e64ca84SGreg Roach            </div>
86dd6b2bfcSGreg Roach        <?php endif ?>
87dd6b2bfcSGreg Roach
888e64ca84SGreg Roach        <div class="dropdown-divider"></div>
898e64ca84SGreg Roach
90*3b3db8adSGreg 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()])) ?>">
9104fe0783SGreg Roach            <?= view('icons/delete') ?>
92dd6b2bfcSGreg Roach            <?= I18N::translate('Delete') ?>
93dd6b2bfcSGreg Roach        </a>
94dd6b2bfcSGreg Roach
95f4afa648SGreg Roach        <?php if (Auth::isAdmin() || $individual->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
96*3b3db8adSGreg Roach            <a class="dropdown-item" href="<?= e(route(EditRawRecordPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
9704fe0783SGreg Roach                <?= view('icons/edit') ?>
98dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the raw GEDCOM') ?>
99dd6b2bfcSGreg Roach            </a>
100dd6b2bfcSGreg Roach        <?php endif ?>
101dd6b2bfcSGreg Roach    </div>
102dd6b2bfcSGreg Roach</div>
103