xref: /webtrees/resources/views/admin/import-progress.phtml (revision b62a8ecaef02a45d7e018fdb0f702d4575d8d0de)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\GedcomLoad;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<div class="progress" id="progress<?= e($tree->id()) ?>">
9    <div
10        class="progress-bar"
11        role="progressbar"
12        aria-valuenow="<?= $progress * 100 ?>"
13        aria-valuemin="0"
14        aria-valuemax="100"
15        style="width: <?= $progress * 100 ?>%; min-width: 40px;"
16    >
17        <?= I18N::percentage($progress, 1) ?>
18    </div>
19</div>
20
21<?php if ($errors === '') : ?>
22    <script>
23        $("#import<?= e($tree->id()) ?>")
24            .load("<?= route(GedcomLoad::class, ['tree' => $tree->name()]) ?>", {});
25    </script>
26<?php else : ?>
27    <div class="alert alert-danger">
28        <?= $errors ?>
29    </div>
30
31    <button class="btn btn-primary" onclick="" id="error-button-<?= $tree->id() ?>">
32        <?= I18N::translate('continue') ?>
33    </button>
34
35    <script>
36        $("#error-button-<?= $tree->id() ?>").click(function () {
37            $("#import<?= e($tree->id()) ?>")
38                .load("<?= route(GedcomLoad::class, ['tree' => $tree->name()]) ?>", {});
39        });
40    </script>
41<?php endif ?>
42