xref: /webtrees/resources/views/modules/family_nav/sidebar-family.phtml (revision 627d7dbed7a67fd8982bad3a124c1f2d688138bc)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3d70512abSGreg Roachuse Fisharebest\Webtrees\Functions\Functions;
4d70512abSGreg Roach
5d70512abSGreg Roach?>
6dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
7dd6b2bfcSGreg Roach
8dd6b2bfcSGreg Roach<table class="table table-sm wt-facts-table wt-family-navigator-family">
9dd6b2bfcSGreg Roach    <caption class="text-center wt-family-navigator-family-heading">
10dd6b2bfcSGreg Roach        <a href="<?= e($family->url()) ?>">
11dd6b2bfcSGreg Roach            <?= $title ?>
12dd6b2bfcSGreg Roach        </a>
13dd6b2bfcSGreg Roach    </caption>
14dd6b2bfcSGreg Roach    <tbody>
1539ca88baSGreg Roach        <?php foreach ($family->spouses() as $spouse) : ?>
1639ca88baSGreg Roach            <tr class="text-center wt-family-navigator-parent wt-gender-<?= $spouse->sex() ?>">
17eb414fd9SGreg Roach                <th class="align-middle wt-family-navigator-label" scope="row">
18dd6b2bfcSGreg Roach                    <?php if ($spouse === $individual) : ?>
19dd6b2bfcSGreg Roach                        <?= Functions::getCloseRelationshipName($individual, $spouse) ?>
20dd6b2bfcSGreg Roach                        <i class="icon-selected"></i>
211afbbc50SGreg Roach                    <?php elseif ($spouse->childFamilies()->first() !== null) : ?>
22dd6b2bfcSGreg Roach                    <div class="dropdown">
23c0935879SGreg Roach                        <a class="dropdown-toggle" href="#" role="button" id="dropdown-<?= e($spouse->xref()) ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
24dd6b2bfcSGreg Roach                            <?= Functions::getCloseRelationshipName($individual, $spouse) ?>
25dd6b2bfcSGreg Roach                        </a>
26dd6b2bfcSGreg Roach
27dd6b2bfcSGreg Roach                        <div class="dropdown-menu wt-family-navigator-dropdown">
28dd6b2bfcSGreg Roach                            <div class="dropdown-header wt-family-navigator-dropdown-heading">
29dd6b2bfcSGreg Roach                                <?= I18N::translate('Parents') ?>
30dd6b2bfcSGreg Roach                            </div>
311afbbc50SGreg Roach                            <?php foreach ($spouse->childFamilies()->first()->spouses() as $parent) : ?>
32dd6b2bfcSGreg Roach                                <a class="dropdown-item" href="<?= e($parent->url()) ?>">
3339ca88baSGreg Roach                                    <?= $parent->fullName() ?>
34dd6b2bfcSGreg Roach                                </a>
35dd6b2bfcSGreg Roach                            <?php endforeach ?>
36dd6b2bfcSGreg Roach                        </div>
37dd6b2bfcSGreg Roach                    </div>
38dd6b2bfcSGreg Roach                    <?php else : ?>
39dd6b2bfcSGreg Roach                        <?= Functions::getCloseRelationshipName($individual, $spouse) ?>
40dd6b2bfcSGreg Roach                    <?php endif ?>
41dd6b2bfcSGreg Roach                </th>
42dd6b2bfcSGreg Roach
43dd6b2bfcSGreg Roach                <td class="wt-family-navigator-name">
44dd6b2bfcSGreg Roach                    <?php if ($spouse->canShow()) : ?>
45dd6b2bfcSGreg Roach                        <a href="<?= e($spouse->url()) ?>">
4639ca88baSGreg Roach                            <?= $spouse->fullName() ?>
47dd6b2bfcSGreg Roach                        </a>
48dd6b2bfcSGreg Roach                        <div class="small">
495e6816beSGreg Roach                            <?= $spouse->lifespan() ?>
50dd6b2bfcSGreg Roach                        </div>
51dd6b2bfcSGreg Roach                    <?php else : ?>
5239ca88baSGreg Roach                        <?= $spouse->fullName() ?>
53dd6b2bfcSGreg Roach                    <?php endif ?>
54dd6b2bfcSGreg Roach                </td>
55dd6b2bfcSGreg Roach            </tr>
56dd6b2bfcSGreg Roach        <?php endforeach ?>
57dd6b2bfcSGreg Roach
5839ca88baSGreg Roach        <?php foreach ($family->children() as $child) : ?>
5939ca88baSGreg Roach            <tr class="text-center wt-family-navigator-child wt-gender-<?= $child->sex() ?>">
60*627d7dbeSGreg Roach                <th class="align-middle wt-family-navigator-label" scope="row">
61dd6b2bfcSGreg Roach                    <?php if ($child === $individual) : ?>
62dd6b2bfcSGreg Roach                        <?= Functions::getCloseRelationshipName($individual, $child) ?>
63dd6b2bfcSGreg Roach                        <i class="icon-selected"></i>
64da7f6dd7SGreg Roach                    <?php elseif ($child->spouseFamilies()->isNotEmpty()) : ?>
65dd6b2bfcSGreg Roach                        <div class="dropdown">
66c0935879SGreg Roach                            <a class="dropdown-toggle" href="#" role="button" id="dropdown-<?= e($child->xref()) ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
67dd6b2bfcSGreg Roach                                <?= Functions::getCloseRelationshipName($individual, $child) ?>
68dd6b2bfcSGreg Roach                            </a>
69dd6b2bfcSGreg Roach
70dd6b2bfcSGreg Roach                            <div class="dropdown-menu">
7139ca88baSGreg Roach                                <?php foreach ($child->spouseFamilies() as $n => $in_laws) : ?>
72dd6b2bfcSGreg Roach                                    <?php if ($n > 0) : ?>
73dd6b2bfcSGreg Roach                                        <div class="dropdown-divider"></div>
74dd6b2bfcSGreg Roach                                    <?php endif ?>
75dd6b2bfcSGreg Roach                                    <div class="dropdown-header wt-family-navigator-dropdown-heading">
76dd6b2bfcSGreg Roach                                        <?= I18N::translate('Family') ?>
77dd6b2bfcSGreg Roach                                    </div>
78dd6b2bfcSGreg Roach
7939ca88baSGreg Roach                                    <?php foreach ($in_laws->spouses() as $sibling_in_law) : ?>
80dd6b2bfcSGreg Roach                                        <?php if ($sibling_in_law !== $child) : ?>
81dd6b2bfcSGreg Roach                                            <a class="dropdown-item" href="<?= e($sibling_in_law->url()) ?>">
8239ca88baSGreg Roach                                                <?= $sibling_in_law->fullName() ?>
83dd6b2bfcSGreg Roach                                            </a>
84dd6b2bfcSGreg Roach                                        <?php endif ?>
85dd6b2bfcSGreg Roach                                    <?php endforeach ?>
86dd6b2bfcSGreg Roach
87dd6b2bfcSGreg Roach                                <ul>
8839ca88baSGreg Roach                                    <?php foreach ($in_laws->children() as $child_in_law) : ?>
89dd6b2bfcSGreg Roach                                    <li>
90dd6b2bfcSGreg Roach                                        <a class="dropdown-item" href="<?= e($child_in_law->url()) ?>">
9139ca88baSGreg Roach                                            <?= $child_in_law->fullName() ?>
92dd6b2bfcSGreg Roach                                        </a>
93dd6b2bfcSGreg Roach                                    </li>
94dd6b2bfcSGreg Roach                                    <?php endforeach ?>
95dd6b2bfcSGreg Roach                                </ul>
96dd6b2bfcSGreg Roach                                <?php endforeach ?>
97dd6b2bfcSGreg Roach                            </div>
98dd6b2bfcSGreg Roach                        </div>
99dd6b2bfcSGreg Roach                    <?php else : ?>
100dd6b2bfcSGreg Roach                        <?= Functions::getCloseRelationshipName($individual, $child) ?>
101dd6b2bfcSGreg Roach                    <?php endif ?>
102dd6b2bfcSGreg Roach                </th>
103dd6b2bfcSGreg Roach
104dd6b2bfcSGreg Roach                <td>
105dd6b2bfcSGreg Roach                    <?php if ($child->canShow()) : ?>
106dd6b2bfcSGreg Roach                        <a  href="<?= e($child->url()) ?>">
10739ca88baSGreg Roach                            <?= $child->fullName() ?>
108dd6b2bfcSGreg Roach                        </a>
109dd6b2bfcSGreg Roach                        <div class="small">
1105e6816beSGreg Roach                            <?= $child->lifespan() ?>
111dd6b2bfcSGreg Roach                        </div>
112dd6b2bfcSGreg Roach                    <?php else : ?>
11339ca88baSGreg Roach                        <?= $child->fullName() ?>
114dd6b2bfcSGreg Roach                    <?php endif ?>
115dd6b2bfcSGreg Roach                </td>
116dd6b2bfcSGreg Roach            </tr>
117dd6b2bfcSGreg Roach        <?php endforeach ?>
118dd6b2bfcSGreg Roach    </tbody>
119dd6b2bfcSGreg Roach</table>
120