#macro(rank $rank)#if( $rank<0 )#set( $k = -$rank )${k}k#else#set( $d=$rank+1 )${d}d#end#end #if (!$tour)

## Invalid tournament id

#stop #end #set($round = $math.toInteger($!params.round)) #if(!$round) #set($round = 1) #else #set($round = $math.min($math.max($round, 1), $tour.rounds)) #end #if($tour.type == 'INDIVIDUAL' || $tour.type.startsWith('TEAM')) #set($parts = $api.get("tour/${params.id}/part")) #else #set($parts = $api.get("tour/${params.id}/team")) #end #set($pmap = $utils.toMap($parts)) #set($roundPairing = $api.get("tour/${params.id}/pair/$round")) #if($roundPairing.error)
#stop #end #set($explain = $api.get("tour/${params.id}/explain/$round"))

#foreach($white in $explain.paired)

white black

$white.name $white.firstname

    $white.toPrettyString()

#end
#foreach($black in $explain.paired)

$black.name $black.firstname

    $black.toPrettyString()

#foreach($white in $explain.paired) #if($white.id != $black.id) #set($key = "$white.id-$black.id") #set($weights = $explain.weights[$key]) #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 + 40 * (1 - ($explain.max - $weights.total) / ($explain.max - $explain.high)) ) #end #end #set($game = $explain.games[$key])

    #if($weights)$weights.toPrettyString()#{else}Bye Player#end

#else

#end #end
#end