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