diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt index e0a2f13..b28e94a 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairing.kt @@ -45,7 +45,7 @@ data class MainCritParams( val drawUpDownUpperMode: DrawUpDown = DrawUpDown.BOTTOM, val drawUpDownLowerMode: DrawUpDown = DrawUpDown.TOP, val seedingWeight: Double = MAX_SEEDING_WEIGHT, // 5 *10^6, opengotha maximizeSeeding - val lastRoundForSeedSystem1: Int = 1, + val lastRoundForSeedSystem1: Int = 2, val seedSystem1: SeedMethod = SeedMethod.SPLIT_AND_RANDOM, val seedSystem2: SeedMethod = SeedMethod.SPLIT_AND_FOLD, val additionalPlacementCritSystem1: Criterion = Criterion.RATING, @@ -226,6 +226,7 @@ fun BaseCritParams.toJson() = Json.Object( "nx1" to nx1, "dupWeight" to dupWeight, "random" to random, + "deterministic" to deterministic, "colorBalanceWeight" to colorBalanceWeight ) diff --git a/view-webapp/src/main/sass/main.scss b/view-webapp/src/main/sass/main.scss index 4919ec1..cfe16a7 100644 --- a/view-webapp/src/main/sass/main.scss +++ b/view-webapp/src/main/sass/main.scss @@ -207,6 +207,26 @@ .step:last-child { padding-right: 1em; } .step .description { display: none; } + label input[type="checkbox"] { + vertical-align: baseline; + } + + .ui.form .inline.fields select, .ui.form label select { + width: initial; + } + + .ui.accordion .content { + display: block; + max-height: 0; + overflow-y: hidden; + padding: 0 1em 0 2em; + transition: all 0.5s ease-out; + &.active { + padding: 0.5em 1em 0.5em 2em; + max-height: 600px; + } + } + .ui.form input[type=text], .ui.form input[type="number"], .ui.form select { padding: 0.4em 0.2em; } @@ -228,7 +248,7 @@ background-clip: initial; } - .ui.form label input[type="checkbox"] { + .ui.form label input[type="checkbox"]:not(.inline) { margin-left: 1em; vertical-align: baseline; } @@ -325,6 +345,13 @@ margin: auto; z-index: 100; pointer-events: none; + &.wide { + left: 0; + right: 0; + transform: initial; + max-width: max(90vw, 1200px); + width: 90vw; + } div.close { position: absolute; width: 30px; diff --git a/view-webapp/src/main/sass/tour.scss b/view-webapp/src/main/sass/tour.scss index 1c20b17..b86da17 100644 --- a/view-webapp/src/main/sass/tour.scss +++ b/view-webapp/src/main/sass/tour.scss @@ -182,10 +182,6 @@ } #macmahon-groups { - left: 0; - right: 0; - transform: initial; - max-width: max(90vw, 1200px); .popup-content { display: flex; flex-flow: row wrap; diff --git a/view-webapp/src/main/webapp/WEB-INF/translations/fr b/view-webapp/src/main/webapp/WEB-INF/translations/fr index 8920f38..0d43578 100644 --- a/view-webapp/src/main/webapp/WEB-INF/translations/fr +++ b/view-webapp/src/main/webapp/WEB-INF/translations/fr @@ -11,6 +11,7 @@ : This mode is the best suited for big Go events like congresses, it allows to register players, enter results and manage pairing from several workstations at once. : Ce mode est le plus adapté pour de grands événements de Go comme les congrès, il permet d’enregistrer les joueurs, d’entrer les résultats et de gérer les appariements depuis plusieurs postes à la fois. : the : le projet Add player Ajouter +Advanced parameters Paramètres avancés At its core,   Browse Parcourir les sources de Byo-yomi periods Périodes de byo-yomi @@ -64,6 +65,7 @@ Mac Mahon groups Groupes Mac Mahon MacMahon MacMahon Main time Temps principal Max time Temps max +MM floor Plancher MM Name Nom Nbw NbV New Tournament Nouveau Tournoi diff --git a/view-webapp/src/main/webapp/js/main.js b/view-webapp/src/main/webapp/js/main.js index 07bb21b..16b5b51 100644 --- a/view-webapp/src/main/webapp/js/main.js +++ b/view-webapp/src/main/webapp/js/main.js @@ -269,5 +269,15 @@ onLoad(() => { let scroll = $('#center')[0].scrollTop; }, 200); } + $('.accordion .title').on('click', e => { + let accordion = e.target.closest('.accordion'); + let title = e.target.closest('.title'); + let content = title.nextElementSibling; + if (!title.hasClass('active')) { + accordion.find('.active').removeClass('active'); + } + title.toggleClass('active'); + content.toggleClass('active'); + }); }); diff --git a/view-webapp/src/main/webapp/js/tour-information.inc.js b/view-webapp/src/main/webapp/js/tour-information.inc.js index c8b2d89..d1617ec 100644 --- a/view-webapp/src/main/webapp/js/tour-information.inc.js +++ b/view-webapp/src/main/webapp/js/tour-information.inc.js @@ -15,6 +15,10 @@ onLoad(() => { return false; }); + $('#parameters').on('click', e => { + modal('parameters-modal'); + }); + $('#validate').on('click', e => { let form = e.target.closest('form'); let valid = true; @@ -177,13 +181,59 @@ onLoad(() => { if (typeof(tour_id) !== 'undefined') { api.putJson(`tour/${tour_id}`, tour) .then(tour => { - window.location.reload(); + if (tour !== 'error') { + window.location.reload(); + } }); } else { api.postJson('tour', tour) .then(tour => { - window.location.href += `?id=${tour.id}`; + if (tour !== 'error') { + window.location.href += `?id=${tour.id}`; + } }); } }); + $('#update-parameters').on('click', e => { + let form = $('#parameters-form')[0]; + let tour = { + pairing: { + base: { + deterministic: form.val('deterministic'), + colorBalanceWeight: form.val('colorBalance') ? 1000000.0 : 0.0 // TODO use client side boolean + }, + main: { + mmsValueAbsent: form.val('mmsValueAbsent'), + firstSeedLastRound: form.val('firstSeedLastRound'), + firstSeedAddCrit: form.val('firstSeedAddRating') ? 'RATING' : 'NONE', // TODO use client side boolean + firstSeed: form.val('firstSeed'), + secondSeedAddCrit: form.val('secondSeedAddRating') ? 'RATING' : 'NONE', // TODO use client side boolean + secondSeed: form.val('secondSeed'), + upDownCompensate: form.val('upDownCompoensate'), + upDownUpperMode: form.val('upDownUpperMode'), + upDownLowerMode: form.val('upDownLowerMode') + }, + secondary: { + rankThreshold: form.val('rankThreshold'), + winsThreshold: form.val('winsThreshold'), + barThreshold: form.val('barThreshold') + }, + geo: { + mmsDiffCountry: form.val('mmsDiffCountry'), + mmsDiffClub: form.val('mmsDiffClub') + }, + handicap: { + useMMS: form.val('useMMS'), + ceiling: form.val('ceiling') + } + } + } + console.log(tour); + api.putJson(`tour/${tour_id}`, tour) + .then(tour => { + if (tour !== 'error') { + window.location.reload(); + } + }); + }); }); diff --git a/view-webapp/src/main/webapp/tour-information.inc.html b/view-webapp/src/main/webapp/tour-information.inc.html index fde016c..a2802bb 100644 --- a/view-webapp/src/main/webapp/tour-information.inc.html +++ b/view-webapp/src/main/webapp/tour-information.inc.html @@ -44,7 +44,7 @@
@@ -82,22 +82,20 @@ -#* MM floor parameter not shown on creation page - -*# + +#if($tour) + +#end diff --git a/view-webapp/src/main/webapp/tour-parameters.inc.html b/view-webapp/src/main/webapp/tour-parameters.inc.html index e69de29..9ff1e46 100644 --- a/view-webapp/src/main/webapp/tour-parameters.inc.html +++ b/view-webapp/src/main/webapp/tour-parameters.inc.html @@ -0,0 +1,155 @@ +
+
+
+ + Base parameters +
+
+
+ +
+
+ +
+
+
+ + Main parameters +
+
+#if($tour.pairing.type == 'MAC_MAHON') +
+
+ +
+
+#end +
+
+ + Seeding methods inside groups of same score +
+
+
+ +
+
+
+ + + +
+
+ + + +
+
+
+
+ + Draw-up / draw-down between groups of same score +
+
+
+ +
+
+ +
+
+
+
+
+ + Secondary parameters +
+
+
+ + + + +
+
+
+ + Geographical parameters +
+
+
+ +
+
+ +
+
+
+ + Handicap parameters +
+
+
+ +
+
+ +
+
+
+
diff --git a/view-webapp/src/main/webapp/tour-registration.inc.html b/view-webapp/src/main/webapp/tour-registration.inc.html index 4345639..23afa5c 100644 --- a/view-webapp/src/main/webapp/tour-registration.inc.html +++ b/view-webapp/src/main/webapp/tour-registration.inc.html @@ -215,7 +215,7 @@ #set($mmbase = []) #end #set($mmsMap = $utils.getMmsMap($mmbase)) -