diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt index c6dc53e..6fefa10 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt @@ -138,7 +138,17 @@ class FileStore(pathStr: String): Store { entries.mapNotNull { entry -> entry.toFile() }.firstOrNull() - }?.renameTo(path.resolve(filename + "-${timestamp}").toFile()) + }?.let { file -> + val dest = path.resolve(filename + "-${timestamp}").toFile() + if (dest.exists()) { + // it means the user performed several actions in the same second... + // drop the last occurrence + dest.delete() + } + if (!file.renameTo(dest)) { + throw Error("Cannot rename ${file.path} to ${dest.path}") + } + } addTournament(tournament) } diff --git a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsManager.kt b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsManager.kt index 46b607a..79267f1 100644 --- a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsManager.kt +++ b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/RatingsManager.kt @@ -47,9 +47,11 @@ object RatingsManager: Runnable { } } + const val PERIOD = 3600000L + override fun run() { logger.info("launching ratings manager") - timer.scheduleAtFixedRate(Task, 0L, 3600000L) + timer.scheduleAtFixedRate(Task, 0L, PERIOD) } object Task: TimerTask() { override fun run() { diff --git a/view-webapp/src/main/sass/main.scss b/view-webapp/src/main/sass/main.scss index 196dd5d..3f95e0a 100644 --- a/view-webapp/src/main/sass/main.scss +++ b/view-webapp/src/main/sass/main.scss @@ -43,6 +43,12 @@ color: darkred; } + .warning { + color: darkred; + font-weight: bold; + font-style: italic; + } + /* header, center, footer */ #header { @@ -302,17 +308,21 @@ } #backdrop { - display: none; + display: block; + background-color: rgba(0,0,0,0.2); + opacity: 0; + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 999; + transition: opacity 500s ease-out; + pointer-events: none; &.active { - display: block; - position: absolute; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - z-index: 999; - background-color: rgba(0,0,0,0.2); + pointer-events: initial; cursor: wait; + opacity: 1; } } diff --git a/view-webapp/src/main/sass/tour.scss b/view-webapp/src/main/sass/tour.scss index 6085a80..5a380d4 100644 --- a/view-webapp/src/main/sass/tour.scss +++ b/view-webapp/src/main/sass/tour.scss @@ -341,6 +341,7 @@ } } .player { + min-width: 12em; &.winner { color: darkred; font-weight: bold; diff --git a/view-webapp/src/main/webapp/WEB-INF/translations/fr b/view-webapp/src/main/webapp/WEB-INF/translations/fr index 7446e6e..ad60228 100644 --- a/view-webapp/src/main/webapp/WEB-INF/translations/fr +++ b/view-webapp/src/main/webapp/WEB-INF/translations/fr @@ -189,3 +189,5 @@ Log in using Se connecter avec (reserved to FFG actors) (réservé aux acteurs FFG) Log in using an email Se connecter avec un email password mot de passe +Warning: publishing partial results at round Attention: publication partielle des résultats à la ronde +out of sur \ No newline at end of file diff --git a/view-webapp/src/main/webapp/js/tour-registration.inc.js b/view-webapp/src/main/webapp/js/tour-registration.inc.js index 928ef4e..631d17b 100644 --- a/view-webapp/src/main/webapp/js/tour-registration.inc.js +++ b/view-webapp/src/main/webapp/js/tour-registration.inc.js @@ -198,8 +198,17 @@ onLoad(() => { // $('#player-form')[0].requestSubmit() not working?! $('#player-form')[0].dispatchEvent(new CustomEvent('submit', {cancelable: true})); }); + $('#search-form').on('submit', e => { + // this form is never meant to be submitted + e.preventDefault(); + return false; + }); $('#player-form').on('submit', e => { e.preventDefault(); + if ($('#register').hasClass('disabled')) { + // user pressed enter + return false; + } let form = $('#player-form')[0]; let player = { name: form.val('name'), diff --git a/view-webapp/src/main/webapp/tour-registration.inc.html b/view-webapp/src/main/webapp/tour-registration.inc.html index 14cf7f8..3d1fcab 100644 --- a/view-webapp/src/main/webapp/tour-registration.inc.html +++ b/view-webapp/src/main/webapp/tour-registration.inc.html @@ -221,7 +221,7 @@