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