xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision 9e18e23b968678b192e5541acd3252e4978d69c3)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactAction;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<h2 class="wt-page-title"><?= $title ?></h2>
9
10<form method="post" action="<?= e(route(EditRawFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
11    <?= csrf_field() ?>
12
13    <p class="text-muted small">
14        <?= I18N::translate('This page allows you to bypass the usual forms, and edit the underlying data directly. It is an advanced option, and you should not use it unless you understand the GEDCOM format. If you make a mistake here, it can be difficult to fix.') ?>
15    </p>
16    <p class="text-muted small">
17        <?= /* I18N: %s is a URL */ I18N::translate('You can download a copy of the GEDCOM specification from %s.', '<a href="https://wiki.webtrees.net/w/images-en/Ged551-5.pdf">https://wiki.webtrees.net/w/images-en/Ged551-5.pdf</a>') ?>
18    </p>
19
20    <div class="card my-2">
21        <label class="card-header py-1 px-2 d-flex" for="gedcom">
22            <?= $fact->summary() ?>
23        </label>
24        <textarea class="card-body form-control py-1 px-2" id="gedcom" name="gedcom" rows="<?= 5 + preg_match_all('/\n/', $fact->gedcom()) ?>" dir="ltr"><?= e($fact->gedcom()) ?></textarea>
25    </div>
26
27    <div class="row form-group">
28        <div class="col-sm-9 offset-sm-3">
29            <button class="btn btn-primary" type="submit">
30                <?= view('icons/save') ?>
31                <?= /* I18N: A button label. */ I18N::translate('save') ?>
32            </button>
33            <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>">
34                <?= view('icons/cancel') ?>
35                <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
36            </a>
37        </div>
38    </div>
39</form>
40
41