xref: /webtrees/resources/views/admin/trees-create.phtml (revision 37df441a9d09da4ae3e905c2688104073a1b36db)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\Http\RequestHandlers\CreateTreeAction;
7use Fisharebest\Webtrees\I18N;
8
9/**
10 * @var string $title
11 * @var string $tree_name
12 * @var string $tree_title
13 */
14
15?>
16
17<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
18
19<h1><?= $title ?></h1>
20
21
22<form method="post" action="<?= e(route(CreateTreeAction::class)) ?>" class="form-horizontal">
23    <div class="row mb-3">
24        <label for="title" class="col-sm-2 col-form-label">
25            <?= I18N::translate('Family tree title') ?>
26        </label>
27        <div class="col-sm-10">
28            <input class="form-control" id="title" maxlength="255" name="title" required="required" type="text" value="<?= e($tree_title) ?>">
29        </div>
30    </div>
31    <div class="row mb-3">
32        <label for="name" class="col-sm-2 col-form-label">
33            <?= I18N::translate('URL') ?>
34        </label>
35        <div class="col-sm-10">
36            <div class="input-group" dir="ltr">
37                <span class="input-group-text" dir="ltr">
38                    <?= e(explode('{tree}', rawurldecode(route('example')))[0]) ?>
39                </span>
40
41                <input class="form-control" id="name" maxlength="31" name="name" pattern="[^&lt;&gt;&quot;*?{}():/\\$%|]*" required="required" type="text" value="<?= e($tree_name) ?>" dir="ltr">
42
43                <span class="input-group-text" dir="ltr">
44                    <?= e(explode('{tree}', rawurldecode(route('example')))[1]) ?>
45                </span>
46            </div>
47            <div class="form-text">
48                <?= I18N::translate('Avoid spaces and punctuation. A family name might be a good choice.') ?>
49            </div>
50        </div>
51    </div>
52    <div class="row mb-3">
53        <div class="offset-sm-2 col-sm-10">
54            <button type="submit" class="btn btn-primary">
55                <?= view('icons/save') ?>
56                <?= /* I18N: A button label. */
57                I18N::translate('create') ?>
58            </button>
59            <div class="form-text">
60                <?= I18N::translate('After creating the family tree, you will be able to import data from a GEDCOM file.') ?>
61            </div>
62        </div>
63    </div>
64
65    <?= csrf_field() ?>
66</form>
67
68
69<?= view('modals/ajax') ?>
70