diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/Solver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/Solver.kt index 127929f..e95ccc5 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/Solver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/Solver.kt @@ -91,7 +91,7 @@ sealed class Solver( fun pair(): List { // check that at this stage, we have an even number of pairables - // The BYE player should have been added beforehand to make a number of pairables even. + // The BYE player should have been added beforehand to make the number of pairables even. if (pairables.size % 2 != 0) throw Error("expecting an even number of pairables") val builder = GraphBuilder(SimpleDirectedWeightedGraph(DefaultWeightedEdge::class.java)) diff --git a/view-webapp/src/main/sass/explain.scss b/view-webapp/src/main/sass/explain.scss index 0c91fc4..bd6d2cd 100644 --- a/view-webapp/src/main/sass/explain.scss +++ b/view-webapp/src/main/sass/explain.scss @@ -6,6 +6,7 @@ } #pairing-table { border-collapse: collapse; + width: max-content; thead { //border-collapse: collapse; tr { @@ -97,6 +98,7 @@ } td { height: 55px; + width: 55px; border: solid 1px gray; position: relative; &.game::after { diff --git a/view-webapp/src/main/webapp/explain.html b/view-webapp/src/main/webapp/explain.html index b188ca9..62eb2c2 100644 --- a/view-webapp/src/main/webapp/explain.html +++ b/view-webapp/src/main/webapp/explain.html @@ -62,20 +62,21 @@ #if($white.id != $black.id) #set($key = "$white.id-$black.id") #set($weights = $explain.weights[$key]) - #set($toMax = $explain.max - $weights.total) - #set($toMin = $weights.total - $explain.min) - #if ($toMax > $toMin) - ## total is close to min - #set($percent = ($weights.total - $explain.min) / ($explain.low - $explain.min) * 40) - #else - ## total is close to max - #set($percent = 60 + ($explain.max - $weights.total) / ($explain.max - $explain.high) * 40) + #if($weights) + #set($toMax = $explain.max - $weights.total) + #set($toMin = $weights.total - $explain.min) + #if ($toMax > $toMin) + ## total is close to min + #set($percent = ($weights.total - $explain.min) / ($explain.low - $explain.min) * 40) + #else + ## total is close to max + #set($percent = 60 + ($explain.max - $weights.total) / ($explain.max - $explain.high) * 40) + #end #end - #set($game = $explain.games[$key]) - +
-
$weights.toPrettyString()
+
#if($weights)$weights.toPrettyString()#{else}Bye Player#end
#else