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