summaryrefslogtreecommitdiff
path: root/modules/gallery/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/views')
-rw-r--r--modules/gallery/views/admin_advanced_settings.html.php4
-rw-r--r--modules/gallery/views/admin_identity.html.php4
-rw-r--r--modules/gallery/views/admin_maintenance.html.php12
-rw-r--r--modules/gallery/views/admin_modules.html.php4
-rw-r--r--modules/gallery/views/upgrader.html.php59
5 files changed, 51 insertions, 32 deletions
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php
index 32fbc2c3..ff4843ab 100644
--- a/modules/gallery/views/admin_advanced_settings.html.php
+++ b/modules/gallery/views/admin_advanced_settings.html.php
@@ -16,10 +16,9 @@
<th> <?= t("Name") ?> </th>
<th> <?= t("Value") ?></th>
</tr>
- <? $i = 0; ?>
<? foreach ($vars as $var): ?>
<? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
<td> <?= $var->module_name ?> </td>
<td> <?= html::clean($var->name) ?> </td>
<td>
@@ -34,7 +33,6 @@
</a>
</td>
</tr>
- <? $i++ ?>
<? endforeach ?>
</table>
</div>
diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php
index 70fe401f..51eaa58a 100644
--- a/modules/gallery/views/admin_identity.html.php
+++ b/modules/gallery/views/admin_identity.html.php
@@ -46,14 +46,12 @@
<th> <?= t("Active") ?> </th>
<th> <?= t("Description") ?> </th>
</tr>
- <? $i = 0 ?>
<? foreach ($available as $module_name => $description): ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
<? $data = array("name" => "provider"); ?>
<td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td>
<td> <?= t($description) ?> </td>
</tr>
- <? $i++ ?>
<? endforeach ?>
</table>
<input type="submit" value="<?= t("Change")->for_html_attr() ?>" />
diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php
index 7ad75f85..ac597715 100644
--- a/modules/gallery/views/admin_maintenance.html.php
+++ b/modules/gallery/views/admin_maintenance.html.php
@@ -20,9 +20,8 @@
<?= t("Action") ?>
</th>
</tr>
- <? $i = 0; ?>
<? foreach ($task_definitions as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= log::severity_class($task->severity) ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= log::severity_class($task->severity) ?>">
<td class="<?= log::severity_class($task->severity) ?>">
<?= $task->name ?>
</td>
@@ -36,7 +35,6 @@
</a>
</td>
</tr>
- <? $i++ ?>
<? endforeach ?>
</table>
</div>
@@ -68,9 +66,8 @@
<?= t("Action") ?>
</th>
</tr>
- <? $i = 0; ?>
<? foreach ($running_tasks as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>">
<td class="<?= $task->state == "stalled" ? "g-warning" : "" ?>">
<?= gallery::date_time($task->updated) ?>
</td>
@@ -108,7 +105,6 @@
<? endif ?>
</td>
</tr>
- <? $i++ ?>
<? endforeach ?>
</table>
</div>
@@ -141,9 +137,8 @@
<?= t("Action") ?>
</th>
</tr>
- <? $i = 0; ?>
<? foreach ($finished_tasks as $task): ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>">
<td class="<?= $task->state == "success" ? "g-success" : "g-error" ?>">
<?= gallery::date_time($task->updated) ?>
</td>
@@ -187,7 +182,6 @@
</td>
</tr>
<? endforeach ?>
- <? $i++ ?>
</table>
</div>
<? endif ?>
diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php
index 4c4976f8..aebedf09 100644
--- a/modules/gallery/views/admin_modules.html.php
+++ b/modules/gallery/views/admin_modules.html.php
@@ -15,9 +15,8 @@
<th> <?= t("Version") ?> </th>
<th> <?= t("Description") ?> </th>
</tr>
- <? $i = 0 ?>
<? foreach ($available as $module_name => $module_info): ?>
- <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
+ <tr class="<?= text::alternate("g-odd", "g-even") ?>">
<? $data = array("name" => $module_name); ?>
<? if ($module_info->locked) $data["disabled"] = 1; ?>
<td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td>
@@ -25,7 +24,6 @@
<td> <?= $module_info->version ?> </td>
<td> <?= t($module_info->description) ?> </td>
</tr>
- <? $i++ ?>
<? endforeach ?>
</table>
<input type="submit" value="<?= t("Update")->for_html_attr() ?>" />
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>