xref: /webtrees/resources/views/modals/create-repository.phtml (revision a81396241f8b2caf70988b1979e1927e5c8e9398)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Contracts\ElementInterface;
6use Fisharebest\Webtrees\Http\RequestHandlers\CreateRepositoryAction;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\Tree;
9
10/**
11 * @var array<string,ElementInterface> $elements
12 * @var Tree                           $tree
13 */
14
15?>
16
17<form method="post" action="<?= e(route(CreateRepositoryAction::class, ['tree' => $tree->name()])) ?>" id="wt-modal-form">
18    <?= view('modals/header', ['title' => I18N::translate('Create a repository')]) ?>
19
20    <div class="modal-body">
21        <?= view('modals/repository-fields', ['elements' => $elements, 'tree' => $tree]) ?>
22    </div>
23
24    <?= view('modals/footer-save-cancel') ?>
25
26    <?= csrf_field() ?>
27</form>
28
29<script>
30  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
31</script>
32