xref: /webtrees/resources/views/modals/create-repository.phtml (revision e8f2d5646b882a6aeaefe04fcc9625e1418a4a2a)
1<?php
2
3use Fisharebest\Webtrees\Contracts\ElementInterface;
4use Fisharebest\Webtrees\Http\RequestHandlers\CreateRepositoryAction;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Tree;
7
8/**
9 * @var array<string,ElementInterface> $elements
10 * @var Tree                           $tree
11 */
12
13?>
14
15<form method="post" action="<?= e(route(CreateRepositoryAction::class, ['tree' => $tree->name()])) ?>" id="wt-modal-form">
16    <?= csrf_field() ?>
17
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</form>
26
27<script>
28  document.getElementById('wt-modal-form').addEventListener('submit', webtrees.createRecordModalSubmit);
29</script>
30