Skip to content

Commit

Permalink
Add progress bar to rejudging.
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterT committed Nov 25, 2024
1 parent 0d0cd3f commit 5011ed0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion webapp/src/Controller/Jury/RejudgingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -389,6 +391,7 @@ public function viewAction(
$data = [
'rejudging' => $rejudging,
'todo' => $todo,
'done' => $done,
'verdicts' => $verdicts,
'used' => $used,
'verdictTable' => $verdictTable,
Expand Down
9 changes: 8 additions & 1 deletion webapp/templates/jury/rejudging.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@
</tr>
<tr {% if todo <= 0 %}class="d-none"{% endif %}>
<th>Queued</th>
<td><span data-todo>{{ todo }}</span> unfinished judgings</td>
<td>
<span data-todo>{{ todo }}</span> unfinished judgings (out of {{ todo + done }})
<br/>
{% set percent = (done / (todo + done)) * 100 | number_format %}
<div class="progress" style="height: 15px;">
<div class="progress-bar" role="progressbar" style="width: {{ percent }}%;" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</td>
</tr>
{% if repetitions %}
<tr>
Expand Down

0 comments on commit 5011ed0

Please sign in to comment.