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