xref: /webtrees/resources/views/family-page.phtml (revision 4874f72da8279544d9c0a459e2920a9986acfaa0)
1<?php
2
3use Fisharebest\Webtrees\Auth;
4use Fisharebest\Webtrees\Functions\FunctionsPrint;
5use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\View;
8
9?>
10
11<?php if ($record->isPendingDeletion()) : ?>
12    <?php if (Auth::isModerator($record->tree())) : ?>
13        <?= 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('accept-changes', ['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('reject-changes', ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
14    <?php elseif (Auth::isEditor($record->tree())) : ?>
15        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
16    <?php endif ?>
17<?php elseif ($record->isPendingAddition()) : ?>
18    <?php if (Auth::isModerator($record->tree())) : ?>
19        <?= 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('accept-changes', ['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('reject-changes', ['tree' => $record->tree()->name(), 'xref' => $record->xref()])) . '">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
20    <?php elseif (Auth::isEditor($record->tree())) : ?>
21        <?= view('components/alert-warning-dismissible', ['alert' => I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
22    <?php endif ?>
23<?php endif ?>
24
25<div class="d-flex mb-4">
26    <h2 class="wt-page-title mx-auto">
27        <?= $record->fullName() ?>
28    </h2>
29    <?php if ($record->canEdit()) : ?>
30        <?= view('family-page-menu', ['record' => $record]) ?>
31    <?php endif ?>
32</div>
33
34<?php View::push('styles') ?>
35<style>
36    .wt-family-members .wt-chart-box {
37        width: 22.5vw;
38    }
39</style>
40<?php View::endpush() ?>
41
42<div class="wt-page-content">
43    <div class="wt-family-members d-flex">
44        <?= view('family-page-children', ['family' => $record]) ?>
45        <?= view('family-page-parents', ['family' => $record]) ?>
46    </div>
47
48    <h3 class="mt-4"><?= I18N::translate('Facts and events') ?></h3>
49    <table class="table wt-facts-table">
50        <?php if ($facts->isEmpty()) : ?>
51            <tr>
52                <td class="messagebox" colspan="2">
53                    <?= I18N::translate('No facts exist for this family.') ?>
54                </td>
55            </tr>
56        <?php else : ?>
57            <?php foreach ($facts as $fact) : ?>
58                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
59            <?php endforeach ?>
60        <?php endif ?>
61
62        <?php if (Auth::isEditor($record->tree())) : ?>
63            <?= view('edit/paste-fact-row', ['record' => $record, 'facts' => $clipboard_facts]) ?>
64
65            <?php FunctionsPrint::printAddNewFact($record, $facts, 'FAM') ?>
66            <tr>
67                <th scope="row">
68                    <?= I18N::translate('Note') ?>
69                </th>
70                <td>
71                    <a href="<?= e(route('add-fact', ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'NOTE'])) ?>">
72                        <?= I18N::translate('Add a note') ?>
73                    </a>
74                </td>
75            </tr>
76
77            <tr>
78                <th scope="row">
79                    <?= I18N::translate('Shared note') ?>
80                </th>
81                <td class="optionbox">
82                    <a href="<?= e(route('add-fact', ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SHARED_NOTE'])) ?>">
83                        <?= I18N::translate('Add a shared note') ?>
84                    </a>
85                </td>
86            </tr>
87
88            <?php if ($record->tree()->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($record->tree())) : ?>
89                <tr>
90                    <th scope="row">
91                        <?= I18N::translate('Media object') ?>
92                    </th>
93                    <td class="optionbox">
94                        <a href="<?= e(route('add-fact', ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE'])) ?>">
95                            <?= I18N::translate('Add a media object') ?>
96                        </a>
97                    </td>
98                </tr>
99            <?php endif ?>
100
101            <tr>
102                <th scope="row">
103                    <?= I18N::translate('Source') ?>
104                </th>
105                <td>
106                    <a href="<?= e(route('add-fact', ['tree' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SOUR'])) ?>">
107                        <?= I18N::translate('Add a source citation') ?>
108                    </a>
109                </td>
110            </tr>
111        <?php endif ?>
112    </table>
113</div>
114
115<?= view('modals/ajax') ?>
116