xref: /webtrees/resources/views/edit/new-individual.phtml (revision 30e63383b10bafff54347985dcdbd10c40c33f62)
1<?php
2
3use Fisharebest\Webtrees\Auth;
4use Fisharebest\Webtrees\Fact;
5use Fisharebest\Webtrees\Family;
6use Fisharebest\Webtrees\Functions\FunctionsEdit;
7use Fisharebest\Webtrees\Gedcom;
8use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToFamilyAction;
9use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToIndividualAction;
10use Fisharebest\Webtrees\Http\RequestHandlers\AddParentToIndividualAction;
11use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToFamilyAction;
12use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToIndividualAction;
13use Fisharebest\Webtrees\Http\RequestHandlers\AddUnlinkedAction;
14use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactPage;
15use Fisharebest\Webtrees\Http\RequestHandlers\EditFactAction;
16use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
17use Fisharebest\Webtrees\I18N;
18use Fisharebest\Webtrees\Tree;
19
20/**
21 * @var string $cancel_url
22 * @var string $post_url
23 * @var string $title
24 * @var Tree   $tree
25 * @var string $url
26 */
27
28?>
29
30<h2 class="wt-page-title"><?= $title ?></h2>
31
32<form method="post" action="<?= e($post_url) ?>">
33    <?= csrf_field() ?>
34
35    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
36        <?php foreach ($prefix_facts as $fact) : ?>
37            <div class="card mb-2">
38                <div class="card-header">
39                    <?= $fact->label() ?>
40                </div>
41                <div class="card-body pb-1">
42                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $fact->insertMissingSubtags(), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
43                </div>
44            </div>
45        <?php endforeach ?>
46    <?php endforeach ?>
47
48    <div class="row form-group">
49        <div class="col-sm-9 offset-sm-3">
50            <button class="btn btn-primary" type="submit" name="url" value="<?= e($url) ?>">
51                <?= view('icons/save') ?>
52                <?= /* I18N: A button label. */
53                I18N::translate('save') ?>
54            </button>
55            <button class="btn btn-primary" type="submit">
56                <?= view('icons/save') ?>
57                <?= /* I18N: A button label. */
58                I18N::translate('go to new individual') ?>
59            </button>
60            <a class="btn btn-secondary" href="<?= e($cancel_url) ?>">
61                <?= view('icons/cancel') ?>
62                <?= /* I18N: A button label. */
63                I18N::translate('cancel') ?>
64            </a>
65        </div>
66    </div>
67</form>
68
69<?= view('modals/on-screen-keyboard') ?>
70<?= view('modals/ajax') ?>
71<?= view('edit/initialize-calendar-popup') ?>
72