xref: /webtrees/resources/views/family-page.phtml (revision 4e73f0bda96a34c06bd4b8e67501ef4955895fbf)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\Functions\FunctionsCharts; ?>
3<?php use Fisharebest\Webtrees\Functions\FunctionsPrint; ?>
4<?php use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; ?>
5<?php use Fisharebest\Webtrees\I18N; ?>
6<?php use Fisharebest\Webtrees\Module\ModuleThemeInterface; ?>
7
8<?php if ($record->isPendingDeletion()) : ?>
9    <?php if (Auth::isModerator($record->tree())) : ?>
10        <?= 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" onclick="accept_changes(\'' . e($record->xref()) . '\', \'' . e($record->tree()->name()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->xref()) . '\', \'' . e($record->tree()->name()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
11    <?php elseif (Auth::isEditor($record->tree())) : ?>
12        <?= 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')]) ?>
13    <?php endif ?>
14<?php elseif ($record->isPendingAddition()) : ?>
15    <?php if (Auth::isModerator($record->tree())) : ?>
16        <?= 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" onclick="accept_changes(\'' . e($record->xref()) . '\', \'' . e($record->tree()->name()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->xref()) . '\', \'' . e($record->tree()->name()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
17    <?php elseif (Auth::isEditor($record->tree())) : ?>
18        <?= 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')]) ?>
19    <?php endif ?>
20<?php endif ?>
21
22<div class="d-flex mb-4">
23    <h2 class="wt-page-title mx-auto">
24        <?= $record->fullName() ?>
25    </h2>
26    <?php if ($record->canEdit() && !$record->isPendingDeletion()) : ?>
27        <?= view('family-page-menu', ['record' => $record]) ?>
28    <?php endif ?>
29</div>
30
31<div class="wt-page-content">
32    <table id="family-table" class="w-100" role="presentation">
33        <tr style="vertical-align:top;">
34            <td style="width: <?= app(ModuleThemeInterface::class)->parameter('chart-box-x') + 30 ?>px;">
35                <?php FunctionsCharts::printFamilyChildren($record) ?>
36            </td>
37            <td>
38                <table class="w-100" role="presentation">
39                    <tr>
40                        <td class="subheaders"><?= I18N::translate('Parents') ?></td>
41                        <td class="subheaders"><?= I18N::translate('Grandparents') ?></td>
42                    </tr>
43                    <tr>
44                        <td colspan="2">
45                            <?php FunctionsCharts::printFamilyParents($record) ?>
46                            <?php if (Auth::isEditor($record->tree())) : ?>
47                                <?php if ($record->husband() === null) : ?>
48                                    <a href="<?= e(route('add-spouse-to-family', ['ged=' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'HUSB'])) ?>">
49                                        <?= I18N::translate('Add a father') ?>
50                                    </a>
51                                    <br>
52                                <?php endif ?>
53                                <?php if ($record->wife() === null) : ?>
54                                    <a href="<?= e(route('add-spouse-to-family', ['ged=' => $record->tree()->name(), 'xref' => $record->xref(), 'famtag' => 'WIFE'])) ?>">
55                                        <?= I18N::translate('Add a mother') ?>
56                                    </a>
57                                    <br>
58                                <?php endif ?>
59                            <?php endif ?>
60                        </td>
61                    </tr>
62                </table>
63            </td>
64        </tr>
65    </table>
66    <span class="subheaders"><?= I18N::translate('Family group information') ?></span>
67    <table class="table wt-facts-table">
68        <?php if ($facts->isEmpty()) : ?>
69            <tr>
70                <td class="messagebox" colspan="2">
71                    <?= I18N::translate('No facts exist for this family.') ?>
72                </td>
73            </tr>
74        <?php else : ?>
75            <?php foreach ($facts as $fact) : ?>
76                <?php FunctionsPrintFacts::printFact($fact, $record) ?>
77            <?php endforeach ?>
78        <?php endif ?>
79
80        <?php if (Auth::isEditor($record->tree())) : ?>
81            <?= view('edit/paste-fact-row', ['record' => $record, 'facts' => $clipboard_facts]) ?>
82
83            <?php FunctionsPrint::printAddNewFact($record, $facts, 'FAM') ?>
84            <tr>
85                <th scope="row">
86                    <?= I18N::translate('Note') ?>
87                </th>
88                <td>
89                    <a href="<?= e(route('add-fact', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'NOTE'])) ?>">
90                        <?= I18N::translate('Add a note') ?>
91                    </a>
92                </td>
93            </tr>
94
95            <tr>
96                <th scope="row">
97                    <?= I18N::translate('Shared note') ?>
98                </th>
99                <td class="optionbox">
100                    <a href="<?= e(route('add-fact', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SHARED_NOTE'])) ?>">
101                        <?= I18N::translate('Add a shared note') ?>
102                    </a>
103                </td>
104            </tr>
105
106            <?php if ($record->tree()->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($record->tree())) : ?>
107                <tr>
108                    <th scope="row">
109                        <?= I18N::translate('Media object') ?>
110                    </th>
111                    <td class="optionbox">
112                        <a href="<?= e(route('add-fact', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'OBJE']))  ?>">
113                            <?= I18N::translate('Add a media object') ?>
114                        </a>
115                    </td>
116                </tr>
117            <?php endif ?>
118
119            <tr>
120                <th scope="row">
121                    <?= I18N::translate('Source') ?>
122                </th>
123                <td>
124                    <a href="<?= e(route('add-fact', ['ged' => $record->tree()->name(), 'xref' => $record->xref(), 'fact' => 'SOUR'])) ?>">
125                        <?= I18N::translate('Add a source citation') ?>
126                    </a>
127                </td>
128            </tr>
129        <?php endif ?>
130    </table>
131</div>
132
133<?= view('modals/ajax') ?>
134