From 5011ed03e44dec75ebed455d2ef673f0d291fc5d Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Mon, 25 Nov 2024 16:47:50 +0100 Subject: [PATCH] Add progress bar to rejudging. --- webapp/src/Controller/Jury/RejudgingController.php | 5 ++++- webapp/templates/jury/rejudging.html.twig | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/webapp/src/Controller/Jury/RejudgingController.php b/webapp/src/Controller/Jury/RejudgingController.php index 14289b6f5a..1efa99c95d 100644 --- a/webapp/src/Controller/Jury/RejudgingController.php +++ b/webapp/src/Controller/Jury/RejudgingController.php @@ -239,7 +239,9 @@ public function viewAction( if (!$rejudging) { throw new NotFoundHttpException(sprintf('Rejudging with ID %s not found', $rejudgingId)); } - $todo = $this->rejudgingService->calculateTodo($rejudging)['todo']; + $todoAndDone = $this->rejudgingService->calculateTodo($rejudging); + $todo = $todoAndDone['todo']; + $done = $todoAndDone['done']; $verdicts = $this->dj->getVerdicts(['final', 'error']); $verdicts[''] = 'JE'; /* happens for aborted judgings */ @@ -389,6 +391,7 @@ public function viewAction( $data = [ 'rejudging' => $rejudging, 'todo' => $todo, + 'done' => $done, 'verdicts' => $verdicts, 'used' => $used, 'verdictTable' => $verdictTable, diff --git a/webapp/templates/jury/rejudging.html.twig b/webapp/templates/jury/rejudging.html.twig index 2753198c8d..f8f03e145c 100644 --- a/webapp/templates/jury/rejudging.html.twig +++ b/webapp/templates/jury/rejudging.html.twig @@ -78,7 +78,14 @@ Queued - {{ todo }} unfinished judgings + + {{ todo }} unfinished judgings (out of {{ todo + done }}) +
+ {% set percent = (done / (todo + done)) * 100 | number_format %} +
+
+
+ {% if repetitions %}