blob: b81e0be1f89e1159a871bc8c7abcbe3e19dfea1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
<?php
use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Services\RelationshipService;
/**
* @var Individual $individual
* @var Family $family
* @var string $title
*/
?>
<table class="table table-sm wt-facts-table wt-family-navigator-family">
<caption class="text-center wt-family-navigator-family-heading">
<a href="<?= e($family->url()) ?>">
<?= $title ?>
</a>
</caption>
<tbody>
<?php foreach ($family->spouses() as $spouse) : ?>
<tr class="text-center wt-family-navigator-parent wt-gender-<?= $spouse->sex() ?>">
<th class="align-middle wt-family-navigator-label" scope="row">
<?php if ($spouse === $individual) : ?>
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $spouse) ?>
<i class="icon-selected"></i>
<?php elseif ($spouse->childFamilies()->isNotEmpty()) : ?>
<div class="dropdown">
<a class="dropdown-toggle" href="#" role="button" id="dropdown-<?= e($spouse->xref()) ?>" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $spouse) ?>
</a>
<div class="dropdown-menu wt-family-navigator-dropdown">
<?php foreach ($spouse->childFamilies() as $n => $spouse_child_family) : ?>
<?php if ($n > 0) : ?>
<div class="dropdown-divider"></div>
<?php endif ?>
<a class="dropdown-header wt-family-navigator-dropdown-heading" href="<?= e($spouse_child_family->url()) ?>">
<?= I18N::translate('Parents') ?>
</a>
<?php foreach ($spouse_child_family->spouses() as $parent) : ?>
<a class="dropdown-item" href="<?= e($parent->url()) ?>">
<?= $parent->fullName() ?>
</a>
<?php endforeach ?>
<?php endforeach ?>
</div>
</div>
<?php else : ?>
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $spouse) ?>
<?php endif ?>
</th>
<td class="wt-family-navigator-name">
<?php if ($spouse->canShow()) : ?>
<a href="<?= e($spouse->url()) ?>">
<?= $spouse->fullName() ?>
</a>
<div class="small">
<?= $spouse->lifespan() ?>
</div>
<?php else : ?>
<?= $spouse->fullName() ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
<?php foreach ($family->children() as $child) : ?>
<tr class="text-center wt-family-navigator-child wt-gender-<?= $child->sex() ?>">
<th class="align-middle wt-family-navigator-label" scope="row">
<?php if ($child === $individual) : ?>
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $child) ?>
<i class="icon-selected"></i>
<?php elseif ($child->spouseFamilies()->isNotEmpty()) : ?>
<div class="dropdown">
<a class="dropdown-toggle" href="#" role="button" id="dropdown-<?= e($child->xref()) ?>" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $child) ?>
</a>
<div class="dropdown-menu">
<?php foreach ($child->spouseFamilies() as $n => $in_laws) : ?>
<?php if ($n > 0) : ?>
<div class="dropdown-divider"></div>
<?php endif ?>
<a class="dropdown-header wt-family-navigator-dropdown-heading" href="<?= e($in_laws->url()) ?>">
<?= I18N::translate('Family') ?>
</a>
<?php foreach ($in_laws->spouses() as $sibling_in_law) : ?>
<?php if ($sibling_in_law !== $child) : ?>
<a class="dropdown-item" href="<?= e($sibling_in_law->url()) ?>">
<?= $sibling_in_law->fullName() ?>
</a>
<?php endif ?>
<?php endforeach ?>
<ul>
<?php foreach ($in_laws->children() as $child_in_law) : ?>
<li>
<a class="dropdown-item" href="<?= e($child_in_law->url()) ?>">
<?= $child_in_law->fullName() ?>
</a>
</li>
<?php endforeach ?>
</ul>
<?php endforeach ?>
</div>
</div>
<?php else : ?>
<?= app(RelationshipService::class)->getCloseRelationshipName($individual, $child) ?>
<?php endif ?>
</th>
<td>
<?php if ($child->canShow()) : ?>
<a href="<?= e($child->url()) ?>">
<?= $child->fullName() ?>
</a>
<div class="small">
<?= $child->lifespan() ?>
</div>
<?php else : ?>
<?= $child->fullName() ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
|