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