xref: /webtrees/resources/views/individual-page-menu.phtml (revision efd4768b0eab1f325771cdbc6181ff84f85f2149)
15229eadeSGreg Roach<?php
25229eadeSGreg Roach
35229eadeSGreg Roachuse Fisharebest\Webtrees\Auth;
42917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
53b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
6a53fee79SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
73b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
8853f2b8aSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderFamiliesPage;
95229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
105229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
115229eadeSGreg Roachuse Fisharebest\Webtrees\I18N;
12203146cfSGreg Roachuse Fisharebest\Webtrees\Individual;
13853f2b8aSGreg Roachuse Illuminate\Support\Collection;
145229eadeSGreg Roach
15203146cfSGreg Roach/**
16203146cfSGreg Roach * @var Individual         $record
17853f2b8aSGreg Roach * @var Collection<string> $shares
18203146cfSGreg Roach */
1960f314e9SGreg Roach
205229eadeSGreg Roach?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<div class="dropdown wt-page-menu">
23dd6b2bfcSGreg 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">
247f85bc37SGreg Roach        <?= view('icons/menu') ?>
25dd6b2bfcSGreg Roach        <?= I18N::translate('edit') ?>
26dd6b2bfcSGreg Roach    </button>
2704fe0783SGreg Roach
28dd6b2bfcSGreg Roach    <div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
29853f2b8aSGreg Roach        <?php if ($shares->isNotEmpty()): ?>
30853f2b8aSGreg Roach            <button class="dropdown-item"  data-toggle="modal" data-target="#wt-shares-modal">
31853f2b8aSGreg Roach                <?= view('icons/share') ?>
32853f2b8aSGreg Roach                <?= I18N::translate('Share') ?>
33853f2b8aSGreg Roach            </button>
34853f2b8aSGreg Roach
35853f2b8aSGreg Roach            <hr>
36853f2b8aSGreg Roach        <?php endif ?>
37853f2b8aSGreg Roach
38*efd4768bSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'NAME'])) ?>">
3904fe0783SGreg Roach            <?= view('icons/add') ?>
40dd6b2bfcSGreg Roach            <?= I18N::translate('Add a name') ?>
41dd6b2bfcSGreg Roach        </a>
42dd6b2bfcSGreg Roach
43203146cfSGreg Roach        <?php if ($record->facts(['NAME'], false, null, true)->count() > 1) : ?>
44203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderNamesPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
4504fe0783SGreg Roach                <?= view('icons/reorder') ?>
46dd6b2bfcSGreg Roach                <?= I18N::translate('Re-order names') ?>
47dd6b2bfcSGreg Roach            </a>
488e64ca84SGreg Roach        <?php else : ?>
498e64ca84SGreg Roach            <div class="dropdown-item disabled">
508e64ca84SGreg Roach                <?= view('icons/spacer') ?>
518e64ca84SGreg Roach                <?= I18N::translate('Re-order names') ?>
528e64ca84SGreg Roach            </div>
53dd6b2bfcSGreg Roach        <?php endif ?>
54dd6b2bfcSGreg Roach
5504fe0783SGreg Roach        <div class="dropdown-divider"></div>
5604fe0783SGreg Roach
57203146cfSGreg Roach        <?php if ($record->facts(['SEX'], false, null, true)->isEmpty()) : ?>
58203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['fact' => 'SEX', 'tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
5904fe0783SGreg Roach                <?= view('icons/edit') ?>
60dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the gender') ?>
61dd6b2bfcSGreg Roach            </a>
628e64ca84SGreg Roach        <?php endif ?>
638e64ca84SGreg Roach
64203146cfSGreg Roach        <?php foreach ($record->facts(['SEX'], false, null, true) as $fact) : ?>
658e64ca84SGreg Roach            <?php if ($fact->canEdit()) : ?>
66203146cfSGreg Roach                <a class="dropdown-item" href="<?= e(route(EditFactPage::class, ['xref' => $record->xref(), 'fact_id' => $fact->id(), 'tree' => $record->tree()->name()])) ?>">
678e64ca84SGreg Roach                    <?= view('icons/edit') ?>
688e64ca84SGreg Roach                    <?= I18N::translate('Edit the gender') ?>
698e64ca84SGreg Roach                </a>
708e64ca84SGreg Roach            <?php endif ?>
718e64ca84SGreg Roach        <?php endforeach ?>
7204fe0783SGreg Roach
7304fe0783SGreg Roach        <div class="dropdown-divider"></div>
748e64ca84SGreg Roach
75203146cfSGreg Roach        <?php if ($record->spouseFamilies()->count() > 1 || $record->childFamilies()->count() > 1) : ?>
76203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderFamiliesPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
7783615acfSGreg Roach                <?= view('icons/reorder') ?>
7883615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
7983615acfSGreg Roach            </a>
8083615acfSGreg Roach        <?php else : ?>
8183615acfSGreg Roach            <div class="dropdown-item disabled">
8283615acfSGreg Roach                <?= view('icons/spacer') ?>
8383615acfSGreg Roach                <?= I18N::translate('Re-order families') ?>
8483615acfSGreg Roach            </div>
8583615acfSGreg Roach        <?php endif ?>
8683615acfSGreg Roach
8783615acfSGreg Roach        <div class="dropdown-divider"></div>
8883615acfSGreg Roach
89203146cfSGreg Roach        <a class="dropdown-item" href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
908e64ca84SGreg Roach            <?= view('icons/add') ?>
918e64ca84SGreg Roach            <?= I18N::translate('Add a media object') ?>
928e64ca84SGreg Roach        </a>
938e64ca84SGreg Roach
94203146cfSGreg Roach        <?php if ($record->facts(['OBJE'], false, null, true)->count() > 1) : ?>
95203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(ReorderMediaPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
96a6c1d617SGreg Roach                <?= view('icons/reorder') ?>
978e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
988e64ca84SGreg Roach            </a>
998e64ca84SGreg Roach        <?php else : ?>
1008e64ca84SGreg Roach            <div class="dropdown-item disabled">
1018e64ca84SGreg Roach                <?= view('icons/spacer') ?>
1028e64ca84SGreg Roach                <?= I18N::translate('Re-order media') ?>
1038e64ca84SGreg Roach            </div>
104dd6b2bfcSGreg Roach        <?php endif ?>
105dd6b2bfcSGreg Roach
1068e64ca84SGreg Roach        <div class="dropdown-divider"></div>
1078e64ca84SGreg Roach
108203146cfSGreg Roach        <a class="dropdown-item" href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->fullName())) ?>" data-post-url="<?= e(route(DeleteRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
10904fe0783SGreg Roach            <?= view('icons/delete') ?>
110dd6b2bfcSGreg Roach            <?= I18N::translate('Delete') ?>
111dd6b2bfcSGreg Roach        </a>
112dd6b2bfcSGreg Roach
113203146cfSGreg Roach        <?php if (Auth::isAdmin() || $record->tree()->getPreference('SHOW_GEDCOM_RECORD')) : ?>
114203146cfSGreg Roach            <a class="dropdown-item" href="<?= e(route(EditRawRecordPage::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) ?>">
11504fe0783SGreg Roach                <?= view('icons/edit') ?>
116dd6b2bfcSGreg Roach                <?= I18N::translate('Edit the raw GEDCOM') ?>
117dd6b2bfcSGreg Roach            </a>
118dd6b2bfcSGreg Roach        <?php endif ?>
119dd6b2bfcSGreg Roach    </div>
120dd6b2bfcSGreg Roach</div>
121