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