xref: /webtrees/resources/views/family-page.phtml (revision 02467d3222d9362e48b39bb9221b32134076ae9c)
117dd427eSGreg Roach<?php
217dd427eSGreg Roach
317dd427eSGreg Roachuse Fisharebest\Webtrees\Auth;
4*02467d32SGreg Roachuse Fisharebest\Webtrees\Family;
517dd427eSGreg Roachuse Fisharebest\Webtrees\Functions\FunctionsPrint;
617dd427eSGreg Roachuse Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
72917771cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
822e73debSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptRecord;
922e73debSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectRecord;
1017dd427eSGreg Roachuse Fisharebest\Webtrees\I18N;
1117dd427eSGreg Roachuse Fisharebest\Webtrees\View;
1217dd427eSGreg Roach
1317dd427eSGreg Roach?>
14dd6b2bfcSGreg Roach
15dd6b2bfcSGreg Roach<?php if ($record->isPendingDeletion()) : ?>
16f4afa648SGreg Roach    <?php if (Auth::isModerator($record->tree())) : ?>
170973b4d2SGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesAcceptRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesRejectRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
18f4afa648SGreg Roach    <?php elseif (Auth::isEditor($record->tree())) : ?>
190973b4d2SGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
20dd6b2bfcSGreg Roach    <?php endif ?>
21dd6b2bfcSGreg Roach<?php elseif ($record->isPendingAddition()) : ?>
22f4afa648SGreg Roach    <?php if (Auth::isModerator($record->tree())) : ?>
230973b4d2SGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesAcceptRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" data-post-url="' . e(route(PendingChangesRejectRecord::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
24f4afa648SGreg Roach    <?php elseif (Auth::isEditor($record->tree())) : ?>
250973b4d2SGreg Roach        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . view('help/link', ['topic' => 'pending_changes'])]) ?>
26dd6b2bfcSGreg Roach    <?php endif ?>
27dd6b2bfcSGreg Roach<?php endif ?>
28dd6b2bfcSGreg Roach
29dd6b2bfcSGreg Roach<div class="d-flex mb-4">
30dd6b2bfcSGreg Roach    <h2 class="wt-page-title mx-auto">
3139ca88baSGreg Roach        <?= $record->fullName() ?>
32dd6b2bfcSGreg Roach    </h2>
331450f098SGreg Roach    <?php if ($record->canEdit()) : ?>
34dd6b2bfcSGreg Roach        <?= view('family-page-menu', ['record' => $record]) ?>
35dd6b2bfcSGreg Roach    <?php endif ?>
36dd6b2bfcSGreg Roach</div>
37dd6b2bfcSGreg Roach
3817dd427eSGreg Roach<?php View::push('styles') ?>
3917dd427eSGreg Roach<style>
4017dd427eSGreg Roach    .wt-family-members .wt-chart-box {
4117dd427eSGreg Roach        width: 22.5vw;
4217dd427eSGreg Roach    }
4317dd427eSGreg Roach</style>
4417dd427eSGreg Roach<?php View::endpush() ?>
4517dd427eSGreg Roach
46dd6b2bfcSGreg Roach<div class="wt-page-content">
4717dd427eSGreg Roach    <div class="wt-family-members d-flex">
4817dd427eSGreg Roach        <?= view('family-page-children', ['family' => $record]) ?>
4917dd427eSGreg Roach        <?= view('family-page-parents', ['family' => $record]) ?>
5017dd427eSGreg Roach    </div>
5117dd427eSGreg Roach
5217dd427eSGreg Roach    <h3 class="mt-4"><?= I18N::translate('Facts and events') ?></h3>
53dd6b2bfcSGreg Roach    <table class="table wt-facts-table">
5439ca88baSGreg Roach        <?php if ($facts->isEmpty()) : ?>
55dd6b2bfcSGreg Roach            <tr>
56d224ae93SGreg Roach                <td colspan="2">
57dd6b2bfcSGreg Roach                    <?= I18N::translate('No facts exist for this family.') ?>
58dd6b2bfcSGreg Roach                </td>
59dd6b2bfcSGreg Roach            </tr>
60dd6b2bfcSGreg Roach        <?php else : ?>
61dd6b2bfcSGreg Roach            <?php foreach ($facts as $fact) : ?>
62dd6b2bfcSGreg Roach                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
63dd6b2bfcSGreg Roach            <?php endforeach ?>
64dd6b2bfcSGreg Roach        <?php endif ?>
65dd6b2bfcSGreg Roach
66f4afa648SGreg Roach        <?php if (Auth::isEditor($record->tree())) : ?>
672adcbd9aSGreg Roach            <?= view('edit/paste-fact-row', ['record' => $record, 'facts' => $clipboard_facts]) ?>
682adcbd9aSGreg Roach
69*02467d32SGreg Roach            <?php FunctionsPrint::printAddNewFact($record, $facts, Family::RECORD_TYPE) ?>
70dd6b2bfcSGreg Roach            <tr>
71dd6b2bfcSGreg Roach                <th scope="row">
72dd6b2bfcSGreg Roach                    <?= I18N::translate('Note') ?>
73dd6b2bfcSGreg Roach                </th>
74dd6b2bfcSGreg Roach                <td>
752917771cSGreg Roach                    <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'NOTE'])) ?>">
76dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a note') ?>
77dd6b2bfcSGreg Roach                    </a>
78dd6b2bfcSGreg Roach                </td>
79dd6b2bfcSGreg Roach            </tr>
80dd6b2bfcSGreg Roach
81dd6b2bfcSGreg Roach            <tr>
82dd6b2bfcSGreg Roach                <th scope="row">
83dd6b2bfcSGreg Roach                    <?= I18N::translate('Shared note') ?>
84dd6b2bfcSGreg Roach                </th>
85ac1d7be4SGreg Roach                <td>
862917771cSGreg Roach                    <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SHARED_NOTE'])) ?>">
87dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a shared note') ?>
88dd6b2bfcSGreg Roach                    </a>
89dd6b2bfcSGreg Roach                </td>
90dd6b2bfcSGreg Roach            </tr>
91dd6b2bfcSGreg Roach
92f4afa648SGreg Roach            <?php if ($record->tree()->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($record->tree())) : ?>
93dd6b2bfcSGreg Roach                <tr>
94dd6b2bfcSGreg Roach                    <th scope="row">
95dd6b2bfcSGreg Roach                        <?= I18N::translate('Media object') ?>
96dd6b2bfcSGreg Roach                    </th>
97ac1d7be4SGreg Roach                    <td>
982917771cSGreg Roach                        <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
99dd6b2bfcSGreg Roach                            <?= I18N::translate('Add a media object') ?>
100dd6b2bfcSGreg Roach                        </a>
101dd6b2bfcSGreg Roach                    </td>
102dd6b2bfcSGreg Roach                </tr>
103dd6b2bfcSGreg Roach            <?php endif ?>
104dd6b2bfcSGreg Roach
105dd6b2bfcSGreg Roach            <tr>
106dd6b2bfcSGreg Roach                <th scope="row">
107dd6b2bfcSGreg Roach                    <?= I18N::translate('Source') ?>
108dd6b2bfcSGreg Roach                </th>
109dd6b2bfcSGreg Roach                <td>
1102917771cSGreg Roach                    <a href="<?= e(route(AddNewFact::class, ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SOUR'])) ?>">
111dd6b2bfcSGreg Roach                        <?= I18N::translate('Add a source citation') ?>
112dd6b2bfcSGreg Roach                    </a>
113dd6b2bfcSGreg Roach                </td>
114dd6b2bfcSGreg Roach            </tr>
115dd6b2bfcSGreg Roach        <?php endif ?>
116dd6b2bfcSGreg Roach    </table>
117dd6b2bfcSGreg Roach</div>
118dd6b2bfcSGreg Roach
119dd6b2bfcSGreg Roach<?= view('modals/ajax') ?>
120