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