diff options
Diffstat (limited to 'modules/gallery/views')
-rw-r--r-- | modules/gallery/views/admin_block_platform.html.php | 3 | ||||
-rw-r--r-- | modules/gallery/views/admin_graphics.html.php | 1 | ||||
-rw-r--r-- | modules/gallery/views/admin_maintenance.html.php | 15 | ||||
-rw-r--r-- | modules/gallery/views/admin_maintenance_task.html.php | 20 | ||||
-rw-r--r-- | modules/gallery/views/form_uploadify.html.php | 6 | ||||
-rw-r--r-- | modules/gallery/views/upgrader.html.php | 53 |
6 files changed, 73 insertions, 25 deletions
diff --git a/modules/gallery/views/admin_block_platform.html.php b/modules/gallery/views/admin_block_platform.html.php index b1b8a2f9..379ab0aa 100644 --- a/modules/gallery/views/admin_block_platform.html.php +++ b/modules/gallery/views/admin_block_platform.html.php @@ -18,4 +18,7 @@ <li> <?= t("Server load: %load_average", array("load_average" => $load_average)) ?> </li> + <li> + <?= t("Graphics toolkit: %toolkit", array("toolkit" => module::get_var("gallery", "graphics_toolkit"))) ?> + </li> </ul> diff --git a/modules/gallery/views/admin_graphics.html.php b/modules/gallery/views/admin_graphics.html.php index 3a48e087..ae76f1e1 100644 --- a/modules/gallery/views/admin_graphics.html.php +++ b/modules/gallery/views/admin_graphics.html.php @@ -16,6 +16,7 @@ <h1> <?= t("Graphics settings") ?> </h1> <p> <?= t("Gallery needs a graphics toolkit in order to manipulate your photos. Please choose one from the list below.") ?> + <?= t("Can't decide which toolkit to choose? <a href=\"%url\">We can help!</a>", array("url" => "http://codex.gallery2.org/Gallery3:Choosing_A_Graphics_Toolkit")) ?> </p> <div class="g-block-content"> diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 4bfc57f0..c28def1d 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -109,16 +109,21 @@ <?= html::clean($task->owner()->name) ?> </td> <td> - <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" - class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> - <?= t("cancel") ?> - </a> <? if ($task->state == "stalled"): ?> <a class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all" href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>"> <?= t("resume") ?> </a> <? endif ?> + <? if ($task->get_log()): ?> + <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> + <?= t("view log") ?> + </a> + <? endif ?> + <a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" + class="g-button ui-icon-left ui-state-default ui-corner-all"> + <?= t("cancel") ?> + </a> </td> </tr> <? endforeach ?> @@ -183,7 +188,7 @@ </a> <? if ($task->get_log()): ?> <a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> - <?= t("browse log") ?> + <?= t("view log") ?> </a> <? endif ?> <? else: ?> diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index 76756b66..013ac01f 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -3,6 +3,7 @@ var target_value; var animation = null; var delta = 1; + var consecutive_error_count = 0; animate_progress_bar = function() { var current_value = parseInt($(".g-progress-bar div").css("width").replace("%", "")); if (target_value > current_value) { @@ -26,12 +27,15 @@ $.fn.gallery_hover_init(); } + var FAILED_MSG = <?= t("Something went wrong...sorry! <a>Retry</a> or check the task log for details")->for_js() ?>; + var ERROR_MSG = <?= t("Something went wrong! Trying again in a moment... (__COUNT__)")->for_js() ?>; update = function() { $.ajax({ url: <?= html::js_string(url::site("admin/maintenance/run/$task->id?csrf=$csrf")) ?>, dataType: "json", success: function(data) { target_value = data.task.percent_complete; + consecutive_error_count = 0; if (!animation) { animate_progress_bar(); } @@ -42,6 +46,22 @@ } else { setTimeout(update, 100); } + }, + error: function(req, textStatus, errorThrown) { + if (textStatus == "timeout" || textStatus == "parsererror") { + consecutive_error_count++; + if (consecutive_error_count == 5) { + $("#g-status").html(FAILED_MSG); + $("#g-pause-button").hide(); + $("#g-done-button").show(); + consecutive_error_count = 0; // in case of a manual retry + $("#g-status a").attr("href", "javascript:update()"); + } else { + $("#g-status").html(ERROR_MSG.replace("__COUNT__", consecutive_error_count)); + // Give a little time to back off before retrying + setTimeout(update, 1500 * consecutive_error_count); + } + } } }); } diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index 36f5f284..893bb3b9 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -60,7 +60,7 @@ $("#g-add-photos-status ul").append( "<li id=\"q" + queueID + "\" class=\"g-success\">" + fileObj.name + " - " + <?= t("Completed")->for_js() ?> + "</li>"); - setTimeout(function() { $("#q" + queueID).slideUp("slow") }, 5000); + setTimeout(function() { $("#q" + queueID).slideUp("slow").remove() }, 5000); success_count++; update_status(); return true; @@ -87,8 +87,8 @@ .replace("__TYPE__", errorObj.type)); } $("#g-add-photos-status ul").append( - "<li class=\"g-error\">" + fileObj.name + msg + "</li>"); - $("#g-uploadify" + queueID).remove(); + "<li id=\"q" + queueID + "\" class=\"g-error\">" + fileObj.name + msg + "</li>"); + $("#g-uploadify").uploadifyCancel(queueID); error_count++; update_status(); }, diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 0ce24ef8..1ec49c77 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -10,7 +10,7 @@ </head> <body<? if (locales::is_rtl()) { echo ' class="rtl"'; } ?>> <div id="outer"> - <img src="<?= url::file("modules/gallery/images/gallery.png") ?>" /> + <img id="logo" src="<?= url::file("modules/gallery/images/gallery.png") ?>" /> <div id="inner"> <? if ($can_upgrade): ?> <div id="dialog" style="visibility: hidden"> @@ -31,6 +31,12 @@ array("url" => html::mark_clean(url::base()))) ?> </p> </div> + <div id="failed" style="display: none"> + <h1> <?= t("Some modules failed to upgrade!") ?> </h1> + <p> + <?= t("Failed modules are <span class=\"failed\">highlighted</span>. Try getting newer versions or <a href=\"%admin_modules\">deactivating those modules</a>.", array("admin_modules" => url::site("admin/modules"))) ?> + </p> + </div> </div> <script type="text/javascript"> $(document).ready(function() { @@ -41,6 +47,10 @@ <? if ($done): ?> show_done(); <? endif ?> + + <? if ($failed): ?> + show_failed(); + <? endif ?> }); var show_busy = function() { @@ -55,10 +65,31 @@ $("#done").show(); $("#dialog_close_link").show(); } + + var show_failed = function() { + $("#dialog").css("visibility", "visible"); + $("#failed").show(); + $("#dialog_close_link").show(); + } </script> - <p class="<?= $done ? "muted" : "" ?>"> - <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?> - </p> + <div id="welcome_message"> + <p class="<?= $done ? "muted" : "" ?>"> + <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?> + </p> + </div> + + <? if ($done): ?> + <div id="upgrade_button" class="button muted"> + <?= t("Upgrade all") ?> + </div> + <? else: ?> + <div id="upgrade_button" class="button button-active"> + <a id="upgrade_link" href="<?= url::site("upgrader/upgrade?csrf=" . access::csrf_token()) ?>"> + <?= t("Upgrade all") ?> + </a> + </div> + <? endif ?> + <table> <tr class="<?= $done ? "muted" : "" ?>"> <th class="name"> <?= t("Module name") ?> </th> @@ -68,7 +99,7 @@ <? foreach ($available as $id => $module): ?> <? if ($module->active): ?> - <tr class="<?= $module->version == $module->code_version ? "current" : "upgradeable" ?>" > + <tr class="<?= $module->version == $module->code_version ? "current" : "upgradeable" ?> <?= in_array($id, $failed) ? "failed" : "" ?>" > <td class="name <?= $id ?>"> <?= t($module->name) ?> </td> @@ -85,18 +116,6 @@ <? endforeach ?> </table> - <? 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="<?= $done ? "muted" : "" ?>"> <?= t("The following modules are inactive and don't require an upgrade.") ?> |