xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision 6e9b2106ef8de9279faf02c6e02326f2ecbbf5a5)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactAction;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\Webtrees;
6
7?>
8
9<h2 class="wt-page-title"><?= $title ?></h2>
10
11<form method="post" action="<?= e(route(EditRawFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
12    <?= csrf_field() ?>
13
14    <p class="text-muted small">
15        <?= 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.') ?>
16    </p>
17    <p class="text-muted small">
18        <?= /* I18N: %s is a URL */ I18N::translate('You can download a copy of the GEDCOM specification from %s.', '<a href="' . e(Webtrees::GEDCOM_PDF) . '">' . e(Webtrees::GEDCOM_PDF) . '</a>') ?>
19    </p>
20
21    <div class="card my-2">
22        <label class="card-header py-1 px-2 d-flex" for="gedcom">
23            <?= $fact->summary() ?>
24        </label>
25        <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>
26    </div>
27
28    <div class="row form-group">
29        <div class="col-sm-9 offset-sm-3">
30            <button class="btn btn-primary" type="submit">
31                <?= view('icons/save') ?>
32                <?= /* I18N: A button label. */ I18N::translate('save') ?>
33            </button>
34            <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>">
35                <?= view('icons/cancel') ?>
36                <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
37            </a>
38        </div>
39    </div>
40</form>
41
42