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