xref: /webtrees/resources/views/edit/new-individual.phtml (revision 78606cf427772fbdc5222ff607ee23f43078f94b)
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 GedcomEditService $gedcom_edit_service
11 * @var string            $post_url
12 * @var string            $title
13 * @var Tree              $tree
14 * @var string            $url
15 */
16
17?>
18
19<h2 class="wt-page-title"><?= $title ?></h2>
20
21<form method="post" action="<?= e($post_url) ?>">
22    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
23        <?php foreach ($prefix_facts as $n => $fact) : ?>
24            <div class="card mb-2">
25                <div class="card-header">
26                    <button class="btn btn-small btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#fact-<?= $prefix ?>-<?= $n ?>" aria-expanded="false" aria-controls="fact-<?= $prefix ?>-<?= $n ?>" data-wt-persist="<?= e($fact->tag()) ?>">
27                        <?= view('icons/expand') ?>
28                        <?= view('icons/collapse') ?>
29                    </button>
30                    <?= $fact->label() ?>
31                </div>
32                <div class="card-body pb-1 collapse" id="fact-<?= $prefix ?>-<?= $n ?>">
33                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom_edit_service->insertMissingFactSubtags($fact, false), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
34                </div>
35            </div>
36        <?php endforeach ?>
37    <?php endforeach ?>
38
39    <div class="row mb-3">
40        <div class="col-sm-9 offset-sm-3">
41            <button class="btn btn-primary" type="submit" name="url" value="<?= e($url) ?>">
42                <?= view('icons/save') ?>
43                <?= /* I18N: A button label. */
44                I18N::translate('save') ?>
45            </button>
46            <button class="btn btn-primary" type="submit">
47                <?= view('icons/save') ?>
48                <?= /* I18N: A button label. */
49                I18N::translate('go to new individual') ?>
50            </button>
51            <a class="btn btn-secondary" href="<?= e($url) ?>">
52                <?= view('icons/cancel') ?>
53                <?= /* I18N: A button label. */
54                I18N::translate('cancel') ?>
55            </a>
56        </div>
57    </div>
58
59    <?= csrf_field() ?>
60</form>
61
62<?= view('modals/on-screen-keyboard') ?>
63<?= view('modals/ajax') ?>
64<?= view('edit/initialize-calendar-popup') ?>
65