xref: /webtrees/resources/views/family-page-parents.phtml (revision 30e63383b10bafff54347985dcdbd10c40c33f62)
1<?php
2
3use Fisharebest\Webtrees\Family;
4use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToFamilyPage;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Individual;
7
8/**
9 * @var Family $family
10 */
11
12?>
13<div class="d-flex">
14    <div class="align-self-center">
15        <div class="d-flex">
16            <div class="wt-chart-horizontal-spacer">
17                <div class="wt-chart-horizontal-first-parent"></div>
18            </div>
19
20            <div class="align-self-center">
21                <?php if ($family->husband() instanceof Individual) : ?>
22                    <?= view('chart-box', ['individual' => $family->husband()]) ?>
23                <?php else : ?>
24                <div class="wt-chart-box">
25                    <?php if ($family->canEdit()) : ?>
26                        <a class="btn btn-link" href="<?= e(route(AddSpouseToFamilyPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref(), 'sex' => 'M'])) ?>">
27                            <?= I18N::translate('Add a husband')?>
28                        </a>
29                    <?php endif ?>
30                </div>
31                <?php endif ?>
32            </div>
33
34            <?= view('family-page-grandparents', ['family' => $family, 'parent_family' => $family->husband() ? $family->husband()->childFamilies()->first() : null, 'individual' => $family->husband()]) ?>
35        </div>
36
37        <div class="d-flex">
38            <div class="wt-chart-horizontal-spacer">
39                <div class="wt-chart-horizontal-last-parent"></div>
40            </div>
41
42            <div class="align-self-center">
43                <?php if ($family->wife() instanceof Individual) : ?>
44                    <?= view('chart-box', ['individual' => $family->wife()]) ?>
45                <?php else : ?>
46                    <div class="wt-chart-box">
47                        <?php if ($family->canEdit()) : ?>
48                            <a class="btn btn-link" href="<?= e(route(AddSpouseToFamilyPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref(), 'sex' => 'F'])) ?>">
49                                <?= I18N::translate('Add a wife')?>
50                            </a>
51                        <?php endif ?>
52                    </div>
53                <?php endif ?>
54            </div>
55
56            <?= view('family-page-grandparents', ['family' => $family, 'parent_family' => $family->wife() ? $family->wife()->childFamilies()->first() : null, 'individual' => $family->wife()]) ?>
57        </div>
58    </div>
59</div>
60
61