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