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