xref: /webtrees/resources/views/modules/relatives/tab.phtml (revision a052b5c627807c42c2daf5c1237144d6c4ef29c9)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<div class="wt-sources-tab py-4">
5    <table class="table table-sm wt-facts-table" role="presentation">
6    <tbody>
7        <tr>
8            <td>
9                <label>
10                    <input id="show-date-differences" type="checkbox" data-toggle="collapse" data-target=".wt-date-difference">
11                    <?= I18N::translate('Date differences') ?>
12                </label>
13            </td>
14        </tr>
15    </tbody>
16</table>
17
18<?php if (empty($parent_families) && $can_edit) : ?>
19    <table class="table table-sm wt-facts-table" role="presentation">
20        <tbody>
21            <tr>
22                <td>
23                    <a href="<?= e(route('add-parent-to-individual', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref(), 'gender' => 'M'])) ?>">
24                        <?= I18N::translate('Add a father') ?>
25                    </a>
26                </td>
27            </tr>
28            <tr>
29                <td>
30                    <a href="<?= e(route('add-parent-to-individual', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref(), 'gender' => 'F'])) ?>">
31                        <?= I18N::translate('Add a mother') ?>
32                    </a>
33                </td>
34            </tr>
35        </tbody>
36    </table>
37<?php endif ?>
38
39<!-- Parents -->
40<?php foreach ($parent_families as $family) : ?>
41    <?= view('modules/relatives/family', [
42        'individual'       => $individual,
43        'family'           => $family,
44        'type'             => 'FAMC',
45        'label'            => $individual->getChildFamilyLabel($family),
46        'fam_access_level' => $fam_access_level,
47    ]) ?>
48<?php endforeach ?>
49
50<!-- step-parents -->
51<?php foreach ($step_parent_families as $family) : ?>
52    <?= view('modules/relatives/family', [
53        'individual'       => $individual,
54        'family'           => $family,
55        'type'             => 'FAMC',
56        'label'            => $individual->getStepFamilyLabel($family),
57        'fam_access_level' => $fam_access_level,
58    ]) ?>
59<?php endforeach ?>
60
61<!-- spouses -->
62<?php foreach ($spouse_families as $family) : ?>
63    <?= view('modules/relatives/family', [
64        'individual'       => $individual,
65        'family'           => $family,
66        'type'             => 'FAMS',
67        'label'            => $individual->getSpouseFamilyLabel($family),
68        'fam_access_level' => $fam_access_level,
69    ]) ?>
70<?php endforeach ?>
71
72<!-- step-children -->
73<?php foreach ($step_child_familiess as $family) : ?>
74    <?= view('modules/relatives/family', [
75        'individual'       => $individual,
76        'family'           => $family,
77        'type'             => 'FAMS',
78        'label'            => $family->getFullName(),
79        'fam_access_level' => $fam_access_level,
80    ]) ?>
81<?php endforeach ?>
82
83<?php if ($can_edit) : ?>
84    <br>
85    <table class="table table-sm wt-facts-table" role="presentation">
86        <tbody>
87            <?php if (count($spouse_families) > 1) : ?>
88                <tr>
89                    <td>
90                        <a href="<?= e(route('reorder-spouses', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
91                            <?= I18N::translate('Re-order families') ?>
92                        </a>
93                    </td>
94                </tr>
95            <?php endif ?>
96            <tr>
97                <td>
98                    <a href="<?= e(route('link-child-to-family', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
99                        <?= I18N::translate('Link this individual to an existing family as a child') ?>
100                    </a>
101                </td>
102            </tr>
103
104            <tr>
105                <td>
106                    <a href="<?= e(route('add-spouse-to-individual', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
107                        <?php if ($individual->getSex() !== 'F') : ?>
108                            <?= I18N::translate('Add a wife') ?>
109                        <?php else : ?>
110                            <?= I18N::translate('Add a husband') ?>
111                        <?php endif ?>
112                    </a>
113                </td>
114            </tr>
115
116            <tr>
117                <td>
118                    <a href="<?= e(route('link-spouse-to-individual', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref()])) ?>">
119                        <?php if ($individual->getSex() !== 'F') : ?>
120                            <?= I18N::translate('Add a wife using an existing individual') ?>
121                        <?php else : ?>
122                            <?= I18N::translate('Add a husband using an existing individual') ?>
123                        <?php endif ?>
124                    </a>
125                </td>
126            </tr>
127
128            <tr>
129                <td>
130                    <a href="<?= e(route('add-child-to-individual', ['ged' => $individual->tree()->name(), 'xref' => $individual->xref(), 'gender' => 'U'])) ?>">
131                        <?= I18N::translate('Add a child to create a one-parent family') ?>
132                    </a>
133                </td>
134            </tr>
135        </tbody>
136    </table>
137<?php endif ?>
138</div>
139
140<?php View::push('javascript') ?>
141<script>
142    'use strict';
143
144    persistent_toggle("show-date-differences");
145</script>
146<?php View::endpush() ?>
147