From 08d572db7b925f116b09fbe56f81aad4a87adad4 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Tue, 30 Jan 2024 17:12:22 +0100 Subject: [PATCH] Pairing page: print pairables instead of games when no game yet --- view-webapp/src/main/sass/main.scss | 46 ++++++++++++++----- .../src/main/webapp/js/tour-pairing.inc.js | 3 ++ .../src/main/webapp/tour-pairing.inc.html | 2 +- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/view-webapp/src/main/sass/main.scss b/view-webapp/src/main/sass/main.scss index b94f51f..cbb9c7f 100644 --- a/view-webapp/src/main/sass/main.scss +++ b/view-webapp/src/main/sass/main.scss @@ -442,10 +442,43 @@ margin-top: 0.1em !important; } - #logo, #lang, .steps, #filter-box, #footer, #pairing-left, #pairing-buttons, button, #standings-params, #logout { + #logo, #lang, .steps, #filter-box, #footer, #unpairables, #pairing-buttons, button, #standings-params, #logout, .pairing-stats, .result-sheets { display: none !important; } + body { + &.nogame { + #pairables { + max-height: unset !important; + max-width: unset !important; + font-size: 1rem !important; + line-height: 1.1rem !important; + min-width: 60vw; + &::before { + top: 0; + } + } + #paired { + display: none !important; + } + } + &:not(.nogame) { + #paired { + max-height: unset !important; + max-width: unset !important; + font-size: 1rem !important; + line-height: 1.1rem !important; + min-width: 60vw; + &::before { + top: 0; + } + } + #pairables { + display: none !important; + } + } + } + .circular.label { transform: scale(0.7); } @@ -454,17 +487,6 @@ max-width: unset !important; } - #paired { - max-height: unset !important; - max-width: unset !important; - font-size: 1rem !important; - line-height: 1.1rem !important; - min-width: 60vw; - &::before { - top: 0; - } - } - } .page { 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 f362268..87d4706 100644 --- a/view-webapp/src/main/webapp/js/tour-pairing.inc.js +++ b/view-webapp/src/main/webapp/js/tour-pairing.inc.js @@ -169,4 +169,7 @@ onLoad(()=>{ if (store.has('unpairablesScroll')) $('#unpairables')[0].scrollTop = store('unpairablesScroll'); if (store.has('pairedScroll')) $('#paired')[0].scrollTop = store('pairedScroll'); }, 0); + if ($('#paired .listitem').length === 0) { + $('body').addClass('nogame'); + } }); diff --git a/view-webapp/src/main/webapp/tour-pairing.inc.html b/view-webapp/src/main/webapp/tour-pairing.inc.html index deb3262..8cfcd40 100644 --- a/view-webapp/src/main/webapp/tour-pairing.inc.html +++ b/view-webapp/src/main/webapp/tour-pairing.inc.html @@ -20,7 +20,7 @@ $round - ( $pairables.size() pairable, $games.size() games ) + ( $pairables.size() pairable, $games.size() games )