xref: /webtrees/resources/views/edit/link-spouse-to-individual.phtml (revision dda05045b4c2f9063e99083d2dbff48269db4ac2)
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    <div class="card mb-2">
22        <div class="card-header">
23            <?= $label ?>
24        </div>
25        <div class="card-body pb-1">
26            <?= view('components/select-individual', ['name' => 'spid', 'id' => 'spouse', 'tree' => $tree]) ?>
27        </div>
28    </div>
29
30    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
31        <?php foreach ($prefix_facts as $fact) : ?>
32            <div class="card mb-2">
33                <div class="card-header">
34                    <?= $fact->label() ?>
35                </div>
36                <div class="card-body pb-1">
37                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom_edit_service->insertMissingFactSubtags($fact, false), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
38                </div>
39            </div>
40        <?php endforeach ?>
41    <?php endforeach ?>
42
43    <div class="row mb-3">
44        <div class="col-sm-9 offset-sm-3">
45            <button class="btn btn-primary" type="submit">
46                <?= view('icons/save') ?>
47                <?= /* I18N: A button label. */
48                I18N::translate('save') ?>
49            </button>
50            <a class="btn btn-secondary" href="<?= e($cancel_url) ?>">
51                <?= view('icons/cancel') ?>
52                <?= /* I18N: A button label. */
53                I18N::translate('cancel') ?>
54            </a>
55        </div>
56    </div>
57
58    <?= csrf_field() ?>
59</form>
60