Skip to content

Commit

Permalink
Correción índice ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287568 committed Apr 23, 2024
1 parent 884b8d6 commit 51f226d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/uniovi/controllers/PlayersController.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public String showGlobalRanking(Pageable pageable, Model model) {

model.addAttribute("ranking", ranking.getContent());
model.addAttribute("page", ranking);
model.addAttribute("num", pageable.getPageSize());

return "ranking/globalRanking";
}
Expand All @@ -117,6 +118,7 @@ public String showPlayerRanking(Pageable pageable, Model model, Principal princi

model.addAttribute("ranking", ranking.getContent());
model.addAttribute("page", ranking);
model.addAttribute("num", pageable.getPageSize());

return "ranking/playerRanking";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Now iterate through the playerScores map to display the final rankings -->
<tr th:each="player, iterStat : ${ranking}">
<td th:text="${iterStat.count}"></td>
<td th:text="${iterStat.count + page.getNumber() * num}"></td>
<td th:text="${player[0].username}"></td>
<td th:text="${player[1]}"></td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</thead>
<tbody>
<tr th:each="game, iterStat : ${ranking}">
<td th:text="${iterStat.count}"></td>
<td th:text="${iterStat.count + page.getNumber() * num}"></td>
<td th:text="${game.score}"></td>
<td th:text="${game.getDuration()}"></td>
<td th:text="${game.correctQuestions}"></td>
Expand Down

0 comments on commit 51f226d

Please sign in to comment.