xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision dae8440ab1203b4eb5e333de33e187c1dfc5b759)
1<?php use Fisharebest\Webtrees\FontAwesome; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3
4<h2 class="wt-page-title"><?= $title ?></h2>
5
6<form class="wt-page-content" method="post">
7    <?= csrf_field() ?>
8    <input type="hidden" name="ged" value="<?= e($fact->record()->tree()->name()) ?>">
9    <input type="hidden" name="xref" value="<?= e($fact->record()->xref()) ?>">
10    <input type="hidden" name="fact_id" value="<?= e($fact->id()) ?>">
11
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" dir="ltr" id="gedcom" name="gedcom" pattern="<?= e($pattern) ?>" rows="<?= 5 + preg_match_all('/\n/', $fact->gedcom()) ?>"><?= 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                <?= FontAwesome::decorativeIcon('save') ?>
31                <?= /* I18N: A button label. */ I18N::translate('save') ?>
32            </button>
33            <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>">
34                <?= FontAwesome::decorativeIcon('cancel') ?>
35                <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
36            </a>
37        </div>
38    </div>
39</form>
40
41