xref: /webtrees/resources/views/edit/new-individual.phtml (revision 5cf3b11faf191d83ec5e7576aa8e8fe3fd2ba15d)
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            $post_url
11 * @var string            $title
12 * @var Tree              $tree
13 * @var string            $url
14 */
15
16?>
17
18<h2 class="wt-page-title"><?= $title ?></h2>
19
20<form method="post" action="<?= e($post_url) ?>">
21    <?= csrf_field() ?>
22
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="true" aria-controls="fact-<?= $prefix ?>-<?= $n ?>">
28                        <?= view('icons/expand') ?>
29                        <?= view('icons/collapse') ?>
30                    </button>
31                    <?= $fact->label() ?>
32                </div>
33                <div class="card-body pb-1 collapse show" 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</form>
60
61<?= view('modals/on-screen-keyboard') ?>
62<?= view('modals/ajax') ?>
63<?= view('edit/initialize-calendar-popup') ?>
64