Skip to content

Commit 22b7672

Browse files
committed
Add progress bar to rejudging.
1 parent 0d0cd3f commit 22b7672

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

webapp/src/Controller/Jury/RejudgingController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ public function viewAction(
239239
if (!$rejudging) {
240240
throw new NotFoundHttpException(sprintf('Rejudging with ID %s not found', $rejudgingId));
241241
}
242-
$todo = $this->rejudgingService->calculateTodo($rejudging)['todo'];
242+
$todoAndDone = $this->rejudgingService->calculateTodo($rejudging);
243+
$todo = $todoAndDone['todo'];
244+
$done = $todoAndDone['done'];
243245

244246
$verdicts = $this->dj->getVerdicts(['final', 'error']);
245247
$verdicts[''] = 'JE'; /* happens for aborted judgings */
@@ -389,6 +391,7 @@ public function viewAction(
389391
$data = [
390392
'rejudging' => $rejudging,
391393
'todo' => $todo,
394+
'done' => $done,
392395
'verdicts' => $verdicts,
393396
'used' => $used,
394397
'verdictTable' => $verdictTable,

webapp/templates/jury/rejudging.html.twig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@
7878
</tr>
7979
<tr {% if todo <= 0 %}class="d-none"{% endif %}>
8080
<th>Queued</th>
81-
<td><span data-todo>{{ todo }}</span> unfinished judgings</td>
81+
<td>
82+
<span data-todo>{{ todo }}</span> unfinished judgings (out of {{ todo + done }})
83+
<br/>
84+
{% set percent = (done / (todo + done)) * 100 | number_format %}
85+
<div class="progress" style="height: 15px;">
86+
<div class="progress-bar" role="progressbar" style="width: {{ percent }}%;" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100"></div>
87+
</div>
88+
</td>
8289
</tr>
8390
{% if repetitions %}
8491
<tr>

0 commit comments

Comments
 (0)