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