From 38f2c445bbedbe3ec97b6f499284784918327cf8 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Mon, 19 Aug 2024 13:31:47 +0200 Subject: [PATCH] Default active round to the fist incomplete one --- view-webapp/src/main/webapp/tour.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/view-webapp/src/main/webapp/tour.html b/view-webapp/src/main/webapp/tour.html index 7446fdb..4e343f7 100644 --- a/view-webapp/src/main/webapp/tour.html +++ b/view-webapp/src/main/webapp/tour.html @@ -26,7 +26,20 @@ #if($tour) #set($round = $math.toInteger($!params.round)) #if(!$round) - #set($round = 1) + #set($lastCompleteRound = 0) + #foreach($r in [1..$tour.rounds]) + #set($stats = $tour.stats[$r - 1]) + #if($stats.ready == $stats.games) + #set($lastCompleteRound = $r) + #else + #break + #end + #end + #if($lastCompleteRound) + #set($round = $math.min($lastCompleteRound + 1, $tour.rounds)) + #else + #set($round = 1) + #end #else #set($round = $math.min($math.max($round, 1), $tour.rounds)) #end