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