xref: /webtrees/resources/views/edit/change-family-members.phtml (revision 43322877c77e9a8a16cba087b3fe7e0af63a6800)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3*43322877SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ChangeFamilyMembersAction;
4d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
5d70512abSGreg Roach
6d70512abSGreg Roach?>
7dd6b2bfcSGreg Roach
8dd6b2bfcSGreg Roach<h2 class="wt-page-title"><?= $title ?></h2>
9dd6b2bfcSGreg Roach
10*43322877SGreg Roach<form method="post" action="<?= e(route(ChangeFamilyMembersAction::class, ['tree' => $tree->name()])) ?>" class="wt-page-content" name="changefamform">
11dd6b2bfcSGreg Roach    <?= csrf_field() ?>
12dd6b2bfcSGreg Roach
139022ab66SGreg Roach    <input type="hidden" name="tree" value="<?= e($tree->name()) ?>">
14c0935879SGreg Roach    <input type="hidden" name="xref" value="<?= e($family->xref()) ?>">
15dd6b2bfcSGreg Roach
16dd6b2bfcSGreg Roach    <div class="form-group row">
17dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="HUSB">
1839ca88baSGreg Roach            <?php if ($father !== null && $father->sex() === 'M') : ?>
19dd6b2bfcSGreg Roach                <?= I18N::translate('Husband') ?>
2039ca88baSGreg Roach            <?php elseif ($father !== null && $father->sex() === 'F') : ?>
21dd6b2bfcSGreg Roach                <?= I18N::translate('Wife') ?>
22dd6b2bfcSGreg Roach            <?php else : ?>
23dd6b2bfcSGreg Roach                <?= I18N::translate('Spouse') ?>
24dd6b2bfcSGreg Roach            <?php endif ?>
25dd6b2bfcSGreg Roach        </label>
26dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
27b6c326d8SGreg Roach            <?= view('components/select-individual', ['name' => 'HUSB', 'individual' => $father, 'tree' => $tree]) ?>
28dd6b2bfcSGreg Roach        </div>
29dd6b2bfcSGreg Roach    </div>
30dd6b2bfcSGreg Roach
31dd6b2bfcSGreg Roach    <div class="form-group row">
32dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="WIFE">
3339ca88baSGreg Roach            <?php if ($mother !== null && $mother->sex() === 'M') : ?>
34dd6b2bfcSGreg Roach                <?= I18N::translate('Husband') ?>
3539ca88baSGreg Roach            <?php elseif ($mother !== null && $mother->sex() === 'F') : ?>
36dd6b2bfcSGreg Roach                <?= I18N::translate('Wife') ?>
37dd6b2bfcSGreg Roach            <?php else : ?>
38dd6b2bfcSGreg Roach                <?= I18N::translate('Spouse') ?>
39dd6b2bfcSGreg Roach            <?php endif ?>
40dd6b2bfcSGreg Roach        </label>
41dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
42b6c326d8SGreg Roach            <?= view('components/select-individual', ['name' => 'WIFE', 'individual' => $mother, 'tree' => $tree]) ?>
43dd6b2bfcSGreg Roach        </div>
44dd6b2bfcSGreg Roach    </div>
45dd6b2bfcSGreg Roach
46dd6b2bfcSGreg Roach    <?php foreach ($children as $n => $child) : ?>
47dd6b2bfcSGreg Roach        <div class="form-group row">
48dd6b2bfcSGreg Roach            <label class="col-sm-3 col-form-label wt-page-options-label" for="CHIL<?= e($n) ?>">
4939ca88baSGreg Roach                <?php if ($child !== null && $child->sex() === 'M') : ?>
50dd6b2bfcSGreg Roach                    <?= I18N::translate('Son') ?>
5139ca88baSGreg Roach                <?php elseif ($child !== null && $child->sex() === 'F') : ?>
52dd6b2bfcSGreg Roach                    <?= I18N::translate('Daughter') ?>
53dd6b2bfcSGreg Roach                <?php else : ?>
54dd6b2bfcSGreg Roach                    <?= I18N::translate('Child') ?>
55dd6b2bfcSGreg Roach                <?php endif ?>
56dd6b2bfcSGreg Roach            </label>
57dd6b2bfcSGreg Roach            <div class="col-sm-9 wt-page-options-value">
58b6c326d8SGreg Roach                <?= view('components/select-individual', ['name' => 'CHIL[]', 'id' => 'CHIL' . $n, 'individual' => $child, 'tree' => $tree]) ?>
59dd6b2bfcSGreg Roach            </div>
60dd6b2bfcSGreg Roach        </div>
61dd6b2bfcSGreg Roach    <?php endforeach ?>
62dd6b2bfcSGreg Roach
63dd6b2bfcSGreg Roach    <div class="form-group row">
64dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="CHIL<?= e(count($children) + 1) ?>">
65dd6b2bfcSGreg Roach            <?= I18N::translate('Child') ?>
66dd6b2bfcSGreg Roach        </label>
67dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
68b6c326d8SGreg Roach            <?= view('components/select-individual', ['name' => 'CHIL[]', 'id' => 'CHIL' . (count($children) + 1), 'tree' => $tree]) ?>
69dd6b2bfcSGreg Roach        </div>
70dd6b2bfcSGreg Roach    </div>
71dd6b2bfcSGreg Roach
72dd6b2bfcSGreg Roach    <div class="form-group row">
73dd6b2bfcSGreg Roach        <div class="col-sm-3 wt-page-options-label">
74dd6b2bfcSGreg Roach        </div>
75dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
76dd6b2bfcSGreg Roach            <button class="btn btn-primary" type="submit">
77d993d560SGreg Roach                <?= view('icons/save') ?>
78dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */
79dd6b2bfcSGreg Roach                I18N::translate('save') ?>
80dd6b2bfcSGreg Roach            </button>
81dd6b2bfcSGreg Roach            <a class="btn btn-secondary" href="<?= e($family->url()) ?>">
82d993d560SGreg Roach                <?= view('icons/cancel') ?>
83dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */
84dd6b2bfcSGreg Roach                I18N::translate('cancel') ?>
85dd6b2bfcSGreg Roach            </a>
86dd6b2bfcSGreg Roach        </div>
87dd6b2bfcSGreg Roach    </div>
88dd6b2bfcSGreg Roach</form>
89