xref: /webtrees/resources/views/admin/upgrade/steps.phtml (revision 00b1984e374faddab4698e73088f0c964e529b65)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\View;
6
7?>
8
9<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
10
11<h1><?= $title ?></h1>
12
13<p>
14    <?= I18N::translate('It can take several minutes to download and install the upgrade. Be patient.') ?>
15</p>
16
17<dl>
18    <?php foreach ($steps as $url => $text) : ?>
19    <dt><?= $text ?></dt>
20    <dd class="wt-ajax-load" data-url="<?= e($url) ?>"></dd>
21    <?php endforeach ?>
22</dl>
23
24<?php View::push('javascript') ?>
25<script>
26  function nextAjaxStep() {
27    $("dd:empty:first").each(function(n, el) {
28      $(el).load(el.dataset.url, {}, function (responseText, textStatus, req) {
29        el.innerHTML = responseText;
30        if (textStatus === "error") {
31          $(".wt-ajax-load").removeClass("wt-ajax-load");
32        } else {
33          nextAjaxStep();
34        }
35      });
36
37      // Only process one callback at a time.
38      return false;
39    });
40  }
41
42  nextAjaxStep();
43</script>
44<?php View::endpush() ?>
45