From 73ed05ecf23b4efea0290d6a61d284cd4e43e564 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Wed, 24 May 2023 19:00:07 +1000 Subject: [PATCH] MDL-78341 core: Improve the progress bar style --- lib/outputcomponents.php | 3 ++- lib/templates/progress_bar.mustache | 39 ++++++++++++++++++----------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 672c71299b0..adb09b605ae 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -5151,7 +5151,8 @@ class progress_bar implements renderable, templatable { $estimatemsg = ''; if ($estimate != 0 && is_numeric($estimate)) { - $estimatemsg = format_time(round($estimate)); + // Err on the conservative side and also avoid showing 'now' as the estimate. + $estimatemsg = format_time(ceil($estimate)); } $this->percent = $percent; diff --git a/lib/templates/progress_bar.mustache b/lib/templates/progress_bar.mustache index 56f8212d8f8..82f9cfcb38d 100644 --- a/lib/templates/progress_bar.mustache +++ b/lib/templates/progress_bar.mustache @@ -25,21 +25,29 @@ "width": "500" } }} -
-
-

- -

+
+
+
+
+
+
+
 
+
+
+   + 0% +
{{! We must not use the JS helper otherwise this gets executed too late. }} -