Compare commits

...

1 Commits

Author SHA1 Message Date
320206118a Done 2025-10-08 20:14:20 +02:00
6 changed files with 62 additions and 54 deletions

3
.gitignore vendored
View File

@@ -8,3 +8,6 @@ target
*.iml *.iml
*~ *~
pairgoth.db pairgoth.db
ratings
pairgoth
pairgoth.tar.gz

View File

@@ -1,3 +1,5 @@
# This is largely a mirror of the original, adapted for the Slovenian Go Association.
# Pairgoth # Pairgoth
Welcome to Pairgoth, your Go Pairing Engine! Welcome to Pairgoth, your Go Pairing Engine!

View File

@@ -132,7 +132,7 @@ ${
player.getString("num")!!.padStart(4, ' ') player.getString("num")!!.padStart(4, ' ')
} ${ } ${
"${ "${
player.getString("name")?.toSnake(true) player.getString("name")?.toSnake()
} ${ } ${
player.getString("firstname")?.toSnake() ?: "" player.getString("firstname")?.toSnake() ?: ""

23
build.sh Executable file
View File

@@ -0,0 +1,23 @@
mkdir pairgoth
cp application/target/pairgoth-engine.jar pairgoth/
echo "#!/bin/bash" > pairgoth/run.sh
echo "./jdk-11.0.28+6-jre/bin/java -jar pairgoth-engine.jar" >> pairgoth/run.sh
echo "#!/bin/bash" > pairgoth/get_java.sh
echo "wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.28%2B6/OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz" >> pairgoth/get_java.sh
echo "tar -xzf OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz" >> pairgoth/get_java.sh
chmod +x pairgoth/run.sh
chmod +x pairgoth/get_java.sh
echo "" > pairgoth/pairgoth.properties
echo "webapp.env = prod" >> pairgoth/pairgoth.properties
echo "webapp.url = http://localhost:8080" >> pairgoth/pairgoth.properties
echo "auth = none" >> pairgoth/pairgoth.properties
echo "logger.level = info" >> pairgoth/pairgoth.properties
echo "rating.ffg.enable = false" >> pairgoth/pairgoth.properties
echo "webapp.protocol = http" >> pairgoth/pairgoth.properties
tar -czvf pairgoth.tar.gz pairgoth/

View File

@@ -28,60 +28,40 @@
#stop #stop
#end #end
#set($games = $utils.removeBye($roundPairing.games)) #set($games = $utils.removeBye($roundPairing.games))
#set($pages = ($games.size() + 3) / 4)
#set($items = $pages * 4)
#foreach($i in [1..$items])
#set($j = ($i - 1) / 4 + (($i - 1) % 4) * $pages)
#if($j < $games.size())
#set($game = $games[$j])
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
#else
#set($game = { 't': 'xxx', 'h': 'xxx' })
#set($white = { 'name': 'xxx', 'firstname': 'xxx', 'rank': -99, 'country': 'XX', 'club': 'xxx' })
#set($black = { 'name': 'xxx', 'firstname': 'xxx', 'rank': -99, 'country': 'XX', 'club': 'xxx' })
#end
#if($foreach.index % 4 == 0)
<div class="page">
#end
<div class="page-item"> <table>
<div class="title">$tour.name</div> <tr>
<div class="subtitle"></div> <th>Table</th>
<div class="details"> <th>Black</th>
<div>Table $game.t</div> <th>Rank</th>
<th>White</th>
<th>Rank</th>
<th>Handicap</th>
<th>Komi</th>
</tr>
#set($numOfPlay = $games.size() - 1)
#foreach($i in [0..$numOfPlay])
#set($game = $games[$i])
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
#set($komi = $tour.komi) #set($komi = $tour.komi)
#if($game.h) #set($komi = $komi - $math.floor($komi)) #end #if($game.h) #set($komi = $komi - $math.floor($komi)) #end
<div>Handicap $game.h &nbsp;&dash;&nbsp; Komi $komi</div> #set($table = $i + 1)
<div>Round $round</div> <tr>
</div> <td>Table $table</td>
<div class="instructions"> <td>$black.name $!black.firstname</td>
Surround winner's name or ½-½ <td>#rank($black.rank)</td>
</div> <td>$white.name $!white.firstname</td>
<div class="players"> <td>#rank($white.rank)</td>
<div class="white player"> <td>$game.h</td>
<div class="color">White</div> <td>$komi</td>
<div class="name">$white.name $!white.firstname #rank($white.rank)<br/>#if($white.country)($white.country.toUpperCase()#if($white.club), $white.club#end)#end</div> </tr>
## <div class="pin">$white.egf</div>
</div>
<div class="equal">½-½</div>
<div class="black player">
<div class="color">Black</div>
<div class="name">$black.name $!black.firstname #rank($black.rank)<br/>#if($black.country)($black.country.toUpperCase()#if($black.club), $black.club#end)#end</div>
## <div class="pin">$black.egf</div>
</div>
</div>
<div class="signatures">
<div class="signature">Signature:</div>
<div class="equal">&nbsp;&nbsp;&nbsp;</div>
<div class="signature">Signature:</div>
</div>
</div>
#if($foreach.index % 4 == 3)
</div>
#end
#end #end
</table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
onLoad(() => { onLoad(() => {

View File

@@ -18,21 +18,21 @@
<table id="results-table" class="ui celled striped table"> <table id="results-table" class="ui celled striped table">
<thead class="centered"> <thead class="centered">
<th data-sort-method="number">table</th> <th data-sort-method="number">table</th>
<th>white</th>
<th>black</th> <th>black</th>
<th>white</th>
<th>hd</th> <th>hd</th>
<th>result</th> <th>result</th>
</thead> </thead>
<tbody> <tbody>
#set($dispRst = {'?':'?', 'w':'1-0', 'b':'0-1', '=':'½-½', 'X':'X', '#':'1-1', '0':'0-0'}) #set($dispRst = {'?':'?', 'w':'0-1', 'b':'1-0', '=':'½-½', 'X':'X', '#':'1-1', '0':'0-0'})
#foreach($game in $individualGames) #foreach($game in $individualGames)
#set($white = $plmap[$game.w]) #set($white = $plmap[$game.w])
#set($black = $plmap[$game.b]) #set($black = $plmap[$game.b])
#if($black && $white) #if($black && $white)
<tr id="result-$game.id" data-id="$game.id"> <tr id="result-$game.id" data-id="$game.id">
<td data-sort="$game.t">${game.t}.</td> <td data-sort="$game.t">${game.t}.</td>
<td class="white player #if($game.r == 'w' || $game.r == '#') winner #elseif($game.r == 'b' || $game.r == '0') looser #end" data-id="$white.id" data-sort="$white.name#if($white.firstname) $white.firstname#end"><span>#if($white)$white.name#if($white.firstname) $white.firstname#end #rank($white.rank)#{else}BIP#end</span></td>
<td class="black player #if($game.r == 'b' || $game.r == '#') winner #elseif($game.r == 'w' || $game.r == '0') looser #end" data-id="$black.id" data-sort="$black.name#if($black.firstname) $black.firstname#end"><span>#if($black)$black.name#if($black.firstname) $black.firstname#end #rank($black.rank)#{else}BIP#end</span></td> <td class="black player #if($game.r == 'b' || $game.r == '#') winner #elseif($game.r == 'w' || $game.r == '0') looser #end" data-id="$black.id" data-sort="$black.name#if($black.firstname) $black.firstname#end"><span>#if($black)$black.name#if($black.firstname) $black.firstname#end #rank($black.rank)#{else}BIP#end</span></td>
<td class="white player #if($game.r == 'w' || $game.r == '#') winner #elseif($game.r == 'b' || $game.r == '0') looser #end" data-id="$white.id" data-sort="$white.name#if($white.firstname) $white.firstname#end"><span>#if($white)$white.name#if($white.firstname) $white.firstname#end #rank($white.rank)#{else}BIP#end</span></td>
<td class="handicap centered">$!game.h</td> <td class="handicap centered">$!game.h</td>
<td class="result centered" data-sort="$game.r" data-result="$game.r">$dispRst[$game.r]</td> <td class="result centered" data-sort="$game.r" data-result="$game.r">$dispRst[$game.r]</td>
</tr> </tr>