xref: /webtrees/resources/views/family-page-grandparents.phtml (revision 7c2c99fad7cacd17c98be88238ff735d82c6351b)
117dd427eSGreg Roach<?php
217dd427eSGreg Roach
3*7c2c99faSGreg Roachuse Fisharebest\Webtrees\Family;
47c7d1e03SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddParentToIndividualPage;
57c7d1e03SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToFamilyPage;
617dd427eSGreg Roachuse Fisharebest\Webtrees\I18N;
7*7c2c99faSGreg Roachuse Fisharebest\Webtrees\Individual;
8*7c2c99faSGreg Roach
9*7c2c99faSGreg Roach/**
10*7c2c99faSGreg Roach * @var Individual|null $individual
11*7c2c99faSGreg Roach * @var Family|null     $family
12*7c2c99faSGreg Roach */
1317dd427eSGreg Roach
1417dd427eSGreg Roach?>
1517dd427eSGreg Roach
1617dd427eSGreg Roach<div class="d-flex">
1717dd427eSGreg Roach    <div class="wt-chart-horizontal-spacer">
1817dd427eSGreg Roach        <div class="wt-chart-horizontal-line"></div>
1917dd427eSGreg Roach    </div>
2017dd427eSGreg Roach    <div class="align-self-center">
2117dd427eSGreg Roach        <div class="d-flex">
2217dd427eSGreg Roach            <div class="wt-chart-horizontal-spacer">
2317dd427eSGreg Roach                <div class="wt-chart-horizontal-first-parent"></div>
2417dd427eSGreg Roach            </div>
2517dd427eSGreg Roach
2617dd427eSGreg Roach            <div class="align-self-center">
2717dd427eSGreg Roach                <?php if ($individual === null) : ?>
280d55b628SGreg Roach                    <?= view('chart-box', ['individual' => null]) ?>
2917dd427eSGreg Roach                <?php elseif ($family === null) : ?>
3017dd427eSGreg Roach                    <div class="wt-chart-box">
310d55b628SGreg Roach                        <?php if ($individual->canEdit()) : ?>
327c7d1e03SGreg Roach                            <a class="btn btn-link" href="<?= e(route(AddParentToIndividualPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'gender' => 'M'])) ?>">
3317dd427eSGreg Roach                                <?= I18N::translate('Add a father') ?>
3417dd427eSGreg Roach                            </a>
350d55b628SGreg Roach                        <?php endif ?>
3617dd427eSGreg Roach                    </div>
3717dd427eSGreg Roach                <?php elseif ($family->husband() === null) : ?>
3817dd427eSGreg Roach                    <div class="wt-chart-box">
390d55b628SGreg Roach                        <?php if ($family->canEdit()) : ?>
407c7d1e03SGreg Roach                            <a class="btn btn-link" href="<?= e(route(AddSpouseToFamilyPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref(), 'famtag' => 'HUSB'])) ?>">
4117dd427eSGreg Roach                                <?= I18N::translate('Add a father') ?>
4217dd427eSGreg Roach                            </a>
430d55b628SGreg Roach                        <?php endif ?>
4417dd427eSGreg Roach                    </div>
4517dd427eSGreg Roach                <?php else : ?>
4617dd427eSGreg Roach                    <?= view('chart-box', ['individual' => $family ? $family->husband() : null]) ?>
4717dd427eSGreg Roach                <?php endif ?>
4817dd427eSGreg Roach            </div>
4917dd427eSGreg Roach        </div>
5017dd427eSGreg Roach
5117dd427eSGreg Roach        <div class="d-flex">
5217dd427eSGreg Roach            <div class="wt-chart-horizontal-spacer">
5317dd427eSGreg Roach                <div class="wt-chart-horizontal-last-parent"></div>
5417dd427eSGreg Roach            </div>
5517dd427eSGreg Roach
5617dd427eSGreg Roach            <div class="align-self-center">
5717dd427eSGreg Roach                <?php if ($individual === null) : ?>
580d55b628SGreg Roach                    <?= view('chart-box', ['individual' => null]) ?>
5917dd427eSGreg Roach                <?php elseif ($family === null) : ?>
6017dd427eSGreg Roach                    <div class="wt-chart-box">
610d55b628SGreg Roach                        <?php if ($individual->canEdit()) : ?>
627c7d1e03SGreg Roach                            <a class="btn btn-link" href="<?= e(route(AddParentToIndividualPage::class, ['tree' => $individual->tree()->name(), 'xref' => $individual->xref(), 'gender' => 'F'])) ?>">
6317dd427eSGreg Roach                                <?= I18N::translate('Add a mother') ?>
6417dd427eSGreg Roach                            </a>
650d55b628SGreg Roach                        <?php endif ?>
6617dd427eSGreg Roach                    </div>
6717dd427eSGreg Roach                <?php elseif ($family->wife() === null) : ?>
6817dd427eSGreg Roach                    <div class="wt-chart-box">
690d55b628SGreg Roach                        <?php if ($family->canEdit()) : ?>
707c7d1e03SGreg Roach                            <a class="btn btn-link" href="<?= e(route(AddSpouseToFamilyPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref(), 'famtag' => 'WIFE'])) ?>">
7117dd427eSGreg Roach                                <?= I18N::translate('Add a mother') ?>
7217dd427eSGreg Roach                            </a>
730d55b628SGreg Roach                        <?php endif ?>
7417dd427eSGreg Roach                    </div>
7517dd427eSGreg Roach                <?php else : ?>
7617dd427eSGreg Roach                    <?= view('chart-box', ['individual' => $family ? $family->wife() : null]) ?>
7717dd427eSGreg Roach                <?php endif ?>
7817dd427eSGreg Roach            </div>
7917dd427eSGreg Roach        </div>
8017dd427eSGreg Roach    </div>
8117dd427eSGreg Roach    <?php if ($family !== null) : ?>
8217dd427eSGreg Roach        <div class="align-self-center">
8317dd427eSGreg Roach            <a class="btn btn-text" href="<?= e($family->url()) ?>" title="<?= strip_tags($family->fullName()) ?>">
8417dd427eSGreg Roach                <?= view('icons/arrow-right') ?>
8517dd427eSGreg Roach            </a>
8617dd427eSGreg Roach        </div>
8717dd427eSGreg Roach    <?php endif ?>
8817dd427eSGreg Roach</div>
8917dd427eSGreg Roach
90