From 727b3415216cd1143e7f86abc1fc13cb3e41390e Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Tue, 30 Jan 2024 15:27:33 +0100 Subject: [PATCH] Pairing page: display stats at top, and persist scroll --- view-webapp/src/main/webapp/WEB-INF/translations/fr | 3 +++ view-webapp/src/main/webapp/js/tour-pairing.inc.js | 12 ++++++++++++ view-webapp/src/main/webapp/tour-pairing.inc.html | 1 + view-webapp/src/main/webapp/tour-results.inc.html | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/view-webapp/src/main/webapp/WEB-INF/translations/fr b/view-webapp/src/main/webapp/WEB-INF/translations/fr index 0fdd296..bd30a3e 100644 --- a/view-webapp/src/main/webapp/WEB-INF/translations/fr +++ b/view-webapp/src/main/webapp/WEB-INF/translations/fr @@ -126,6 +126,7 @@ country pays d d first name prénom from de +games ) parties ) h h in a way that best suits your needs. Here are your options: de la manière qui répond le mieux à vos besoin. Voici vos options : instance graciously hosted by the French Go Federation. gracieusement hébergée par la Fédération Française de Go @@ -138,6 +139,7 @@ online tournament tournoi en ligne opengotha OpenGotha or ou pairable players joueurs disponibles +pairable, disponibles, pairgoth pairgoth pairing system, ideal for championships with no handicap games, as well as the , idéal pour les championnats sans handicap, ainsi que le système d’appariement pairing system, more suited for classical tournaments and cups. It is still in a beta stage. Future versions will support more pairing systems and more features. , plus adapté pour les tournois classiques et les coupes. Il en est encore à une phase « beta ». Les versions futures comporteront plus de systèmes d’appariements et de fonctionnalités. @@ -152,6 +154,7 @@ table table the configuration guide le guide de configuration to à unpairable players joueurs non disponibles +unpairable, non disponibles, version 0.1 supports the version 0.1 supporte le système d’appariement white blanc White Blanc diff --git a/view-webapp/src/main/webapp/js/tour-pairing.inc.js b/view-webapp/src/main/webapp/js/tour-pairing.inc.js index 6e9eaf3..ae9b0b9 100644 --- a/view-webapp/src/main/webapp/js/tour-pairing.inc.js +++ b/view-webapp/src/main/webapp/js/tour-pairing.inc.js @@ -159,4 +159,16 @@ onLoad(()=>{ $('#update-pairable').on('click', e => { updatePairable(); }); + window.on('unload', e => { + console.log(store('unpairablesScroll')) + store('pairablesScroll', $('#pairables')[0].scrollTop); + store('unpairablesScroll', $('#unpairables')[0].scrollTop); + store('pairedScroll', $('#paired')[0].scrollTop); + }); + console.log(store('unpairablesScroll')) + setTimeout(() => { + if (store.has('pairablesScroll')) $('#pairables')[0].scrollTop = store('pairablesScroll'); + if (store.has('unpairablesScroll')) $('#unpairables')[0].scrollTop = store('unpairablesScroll'); + if (store.has('pairedScroll')) $('#paired')[0].scrollTop = store('pairedScroll'); + }, 0); }); diff --git a/view-webapp/src/main/webapp/tour-pairing.inc.html b/view-webapp/src/main/webapp/tour-pairing.inc.html index c1d8df4..deb3262 100644 --- a/view-webapp/src/main/webapp/tour-pairing.inc.html +++ b/view-webapp/src/main/webapp/tour-pairing.inc.html @@ -20,6 +20,7 @@ $round + ( $pairables.size() pairable, $games.size() games )
diff --git a/view-webapp/src/main/webapp/tour-results.inc.html b/view-webapp/src/main/webapp/tour-results.inc.html index 7386aea..1b7e480 100644 --- a/view-webapp/src/main/webapp/tour-results.inc.html +++ b/view-webapp/src/main/webapp/tour-results.inc.html @@ -5,7 +5,7 @@ $round #set($stats = $utils.getResultsStats($games)) - $stats.known / $stats.total + ( $stats.known / $stats.total )