diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt index 169f2a1..a9d4db2 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Rules.kt @@ -1,6 +1,7 @@ package org.jeudego.pairgoth.model enum class Rules { + AGA, FRENCH, JAPANESE, CHINESE diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt index 0e13819..ca30008 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt @@ -235,7 +235,7 @@ fun Tournament.Companion.fromJson(json: Json.Object, default: Tournament<*>? = n location = json.getString("location") ?: default?.location ?: badRequest("missing location"), online = json.getBoolean("online") ?: default?.online ?: false, komi = json.getDouble("komi") ?: default?.komi ?: 7.5, - rules = json.getString("rules")?.let { Rules.valueOf(it) } ?: default?.rules ?: Rules.FRENCH, + rules = json.getString("rules")?.let { Rules.valueOf(it) } ?: default?.rules ?: if (json.getString("country")?.lowercase(Locale.ROOT) == "fr") Rules.FRENCH else Rules.AGA, gobanSize = json.getInt("gobanSize") ?: default?.gobanSize ?: 19, timeSystem = json.getObject("timeSystem")?.let { TimeSystem.fromJson(it) } ?: default?.timeSystem ?: badRequest("missing timeSystem"), rounds = json.getInt("rounds") ?: default?.rounds ?: badRequest("missing rounds"), 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 e6db1d5..4250f63 100644 --- a/view-webapp/src/main/webapp/js/tour-information.inc.js +++ b/view-webapp/src/main/webapp/js/tour-information.inc.js @@ -168,6 +168,9 @@ onLoad(() => { country: form.val('country'), online: form.val('online'), location: form.val('location'), + rules: form.val('rules'), + gobanSize: form.val('gobanSize'), + komi: form.val('komi'), pairing: { type: form.val('pairing'), // mmFloor: form.val('mmFloor'), diff --git a/view-webapp/src/main/webapp/tour-information.inc.html b/view-webapp/src/main/webapp/tour-information.inc.html index 103487a..e69133a 100644 --- a/view-webapp/src/main/webapp/tour-information.inc.html +++ b/view-webapp/src/main/webapp/tour-information.inc.html @@ -147,6 +147,7 @@