Files
pairgoth/view-webapp/src/main/webapp/tour-standings.inc.html
2024-04-15 16:33:17 +02:00

132 lines
4.2 KiB
HTML

#macro(placement $i, $p)
<span class="info"></span>
<select name="crit-$i" data-initial="$p" class="short-value">
#foreach($crit in $$utils.criteria.entrySet())
<option value="$crit.key" data-tooltip="$crit.value" #if($p == $crit.key)selected#end>$crit.key - $crit.value</option>
#end
</select>
#end
<div class="tab-content" id="standings-tab">
<div id="standings-round" class="active-round-box">
Standings after round
<button class="ui floating choose-round prev-round button">&laquo;</button>
<span class="active-round">$round</span>
<button class="ui floating choose-round next-round button">&raquo;</button>
</div>
<div id="standings-params" class="roundbox">
<form id="params-form" class="ui form">
<div class="inline fields">
#foreach($placement in $tour.pairing.placement)
<div class="criterium field">
#set($num = $foreach.index + 1)
<label>Crit #$num</label>
#placement($num $placement)
</div>
#end
</div>
<div id="params-submit" class="hidden centered inline fields">
<button type="button" class="ui gray floating cancel button">Cancel</button>
<button type="submit" class="ui blue floating button">Change</button>
</div>
</form>
</div>
<div id="standings-container" class="roundbox">
#set($standings = $api.get("tour/${params.id}/standings/$round"))
#if($standings.isObject() && ($standings.error || $standings.message))
#if($standings.error)
#set($error = $standings.error)
#else
#set($error = $standings.message)
#end
<script type="text/javascript">
onLoad(() => {
showError("$error")
});
</script>
#set($standings = [])
#end
<table id="standings-table" class="ui striped table">
<thead>
<th>Num</th>
<th>Plc</th>
<th>Name</th>
<th>Rank</th>
<th>Ctr</th>
<th>Nbw</th>
#foreach($r in [1..$round])
<th>R$r</th>
#end
#foreach($crit in $tour.pairing.placement)
<th>$crit</th>
#end
</thead>
<tbody>
#foreach($part in $standings)
<tr>
<td>$part.num</td>
<td>$part.place</td>
<td>$part.name#if($part.firstname) $part.firstname#end</td>
<td data-sort="$part.rank">#rank($part.rank)</td>
<td>#if($part.country)$part.country#end</td>
<td>$number.format('0.#', $part.NBW)</td>
#set($mx = $round - 1)
#foreach($r in [0..$mx])
#set($rst = $part.results[$r])
#if($rst.contains('+'))
#set($rst = "<b>$rst</b>")
#elseif($rst.contains('-'))
#set($rst = "<i>$rst</i>")
#end
<td class="nobreak">$rst</td>
#end
#foreach($crit in $tour.pairing.placement)
<td>$number.format('0.#', $part[$crit])</td>
#end
</tr>
#end
</tbody>
</table>
</div>
<div class="right form-actions">
<button id="publish" class="ui yellow floating right labeled icon button">
<i class="paper plane outline icon"></i>
Publish
</button>
</div>
</div>
<div id="publish-modal" class="popup">
<div class="popup-body">
<div class="popup-header">
Publish standings
</div>
<div class="popup-content">
#if($round < $tour.rounds)
<div class="warning">Warning: publishing partial results at round <span>$round</span> out of <span>$tour.rounds</span>!</div>
#end
<form class="ui edit form">
<div class="field">
<label>Encoding</label>
<select id="encoding">
<option value="utf-8">UTF-8</option>
<option value="iso-8859-1">ISO 8859-1</option>
</select>
</div>
<div class="field">
<label>Choose format</label>
<div class="inline fields">
<button type="button" class="ui blue floating publish-html button">HTML</button>
<button type="button" class="ui blue floating publish-csv button">CSV</button>
<button type="button" class="ui blue floating publish-egf button">EGF</button>
<button type="button" class="ui blue floating publish-ffg button">FFG</button>
</div>
</div>
</form>
</div>
<div class="popup-footer">
<div class="form-actions">
<button type="button" class="ui gray floating close button">Cancel</button>
</div>
</div>
</div>
</div>