Skip to content

Commit

Permalink
Merge pull request #205 from Arquisoft/IndiceRanking
Browse files Browse the repository at this point in the history
Corrección índice ranking
  • Loading branch information
Pelayori authored Apr 24, 2024
2 parents 884b8d6 + 51f226d commit 22f450e
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 22f450e

Please sign in to comment.