xref: /webtrees/resources/views/edit/link-spouse-to-individual.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Services\GedcomEditService;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var string            $cancel_url
11 * @var GedcomEditService $gedcom_edit_service
12 * @var string            $label
13 * @var string            $post_url
14 * @var string            $title
15 * @var Tree              $tree
16 */
17
18?>
19
20<h2 class="wt-page-title"><?= $title ?></h2>
21
22<form method="post" action="<?= e($post_url) ?>" class="wt-page-content">
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 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
60    <?= csrf_field() ?>
61</form>
62