xref: /webtrees/resources/views/edit/link-spouse-to-individual.phtml (revision d4ec5ec0fe611c85b1d77527db3e9becde7e473d)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4use Fisharebest\Webtrees\Services\GedcomEditService;
5use Fisharebest\Webtrees\Tree;
6
7/**
8 * @var string            $cancel_url
9 * @var GedcomEditService $gedcom_edit_service
10 * @var string            $label
11 * @var string            $post_url
12 * @var string            $title
13 * @var Tree              $tree
14 */
15
16?>
17
18<h2 class="wt-page-title"><?= $title ?></h2>
19
20<form method="post" action="<?= e($post_url) ?>" class="wt-page-content">
21    <?= csrf_field() ?>
22
23    <div class="card mb-2">
24        <div class="card-header">
25            <?= $label ?>
26        </div>
27        <div class="card-body pb-1">
28            <?= view('components/select-individual', ['name' => 'spid', 'id' => 'spouse', 'tree' => $tree]) ?>
29        </div>
30    </div>
31
32    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
33        <?php foreach ($prefix_facts as $fact) : ?>
34            <div class="card mb-2">
35                <div class="card-header">
36                    <?= $fact->label() ?>
37                </div>
38                <div class="card-body pb-1">
39                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom_edit_service->insertMissingFactSubtags($fact, false), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
40                </div>
41            </div>
42        <?php endforeach ?>
43    <?php endforeach ?>
44
45    <div class="row form-group mb-3">
46        <div class="col-sm-9 offset-sm-3">
47            <button class="btn btn-primary" type="submit">
48                <?= view('icons/save') ?>
49                <?= /* I18N: A button label. */
50                I18N::translate('save') ?>
51            </button>
52            <a class="btn btn-secondary" href="<?= e($cancel_url) ?>">
53                <?= view('icons/cancel') ?>
54                <?= /* I18N: A button label. */
55                I18N::translate('cancel') ?>
56            </a>
57        </div>
58    </div>
59</form>
60