diff options
Diffstat (limited to 'modules/gallery/views/upgrader.html.php')
| -rw-r--r-- | modules/gallery/views/upgrader.html.php | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index fb55c4b2..5cd1cd77 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -11,29 +11,54 @@ <img src="<?= url::file("modules/gallery/images/gallery.png") ?>" /> <div id="inner"> <? if ($can_upgrade): ?> - <? if ($done): ?> - <div id="confirmation"> - <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a> - <div> + <div id="dialog" style="visibility: hidden"> + <a id="dialog_close_link" style="display: none" onclick="$('#dialog').fadeOut(); return false;" href="#" class="close">[x]</a> + <div id="busy" style="display: none"> + <h1> + <img width="16" height="16" src="<?= url::file("lib/images/loading-small.gif") ?>"/> + <?= t("Upgrade in progress!") ?> + </h1> + <p> + <?= t("Please don't refresh or leave the page.") ?> + </p> + </div> + <div id="done" style="display: none"> <h1> <?= t("That's it!") ?> </h1> <p> <?= t("Your <a href=\"%url\">Gallery</a> is up to date.", - array("url" => html::mark_clean(item::root()->url()))) ?> + array("url" => html::mark_clean(item::root()->url()))) ?> </p> </div> </div> <script type="text/javascript"> $(document).ready(function() { - $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2)); - $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2)); + $("#dialog").css("left", Math.round(($(window).width() - $("#dialog").width()) / 2)); + $("#dialog").css("top", Math.round(($(window).height() - $("#dialog").height()) / 2)); + $("#upgrade_link").click(function(event) { show_busy() }); + + <? if ($done): ?> + show_done(); + <? endif ?> }); + + var show_busy = function() { + $("#dialog").css("visibility", "visible"); + $("#busy").show(); + $("#upgrade_link").parent().removeClass("button-active"); + $("#upgrade_link").replaceWith($("#upgrade_link").html()) + } + + var show_done = function() { + $("#dialog").css("visibility", "visible"); + $("#done").show(); + $("#dialog_close_link").show(); + } </script> - <? endif ?> - <p class="gray_on_done"> + <p class="<?= $done ? "muted" : "" ?>"> <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?> </p> <table> - <tr class="gray_on_done"> + <tr class="<?= $done ? "muted" : "" ?>"> <th> <?= t("Module name") ?> </th> <th> <?= t("Installed version") ?> </th> <th> <?= t("Available version") ?> </th> @@ -58,17 +83,23 @@ <? endforeach ?> </table> - <div class="button gray_on_done"> - <a href="<?= url::site("upgrader/upgrade") ?>"> + <? if ($done): ?> + <div class="button muted"> + <?= t("Upgrade all") ?> + </div> + <? else: ?> + <div class="button button-active"> + <a id="upgrade_link" href="<?= url::site("upgrader/upgrade") ?>"> <?= t("Upgrade all") ?> </a> </div> + <? endif ?> <? if (@$inactive): ?> - <p class="gray_on_done"> + <p class="<?= $done ? "muted" : "" ?>"> <?= t("The following modules are inactive and don't require an upgrade.") ?> </p> - <ul class="gray_on_done"> + <ul class="<?= $done ? "muted" : "" ?>"> <? foreach ($available as $module): ?> <? if (!$module->active): ?> <li> |
