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