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