xref: /webtrees/resources/views/edit/new-individual.phtml (revision 701f5d180b85b9d3e0747b6ddc9e9d64dd73d0d6)
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    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
22        <?php foreach ($prefix_facts as $n => $fact) : ?>
23            <div class="card mb-2">
24                <div class="card-header">
25                    <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 ?>">
26                        <?= view('icons/expand') ?>
27                        <?= view('icons/collapse') ?>
28                    </button>
29                    <?= $fact->label() ?>
30                </div>
31                <div class="card-body pb-1 collapse show" id="fact-<?= $prefix ?>-<?= $n ?>">
32                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom_edit_service->insertMissingFactSubtags($fact, false), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
33                </div>
34            </div>
35        <?php endforeach ?>
36    <?php endforeach ?>
37
38    <div class="row mb-3">
39        <div class="col-sm-9 offset-sm-3">
40            <button class="btn btn-primary" type="submit" name="url" value="<?= e($url) ?>">
41                <?= view('icons/save') ?>
42                <?= /* I18N: A button label. */
43                I18N::translate('save') ?>
44            </button>
45            <button class="btn btn-primary" type="submit">
46                <?= view('icons/save') ?>
47                <?= /* I18N: A button label. */
48                I18N::translate('go to new individual') ?>
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
61<?= view('modals/on-screen-keyboard') ?>
62<?= view('modals/ajax') ?>
63<?= view('edit/initialize-calendar-popup') ?>
64