332 lines
13 KiB
HTML
332 lines
13 KiB
HTML
#set($parts = $api.get("tour/${params.id}/part"))
|
|
#if($tour.type == 'INDIVIDUAL' || $tour.type.startsWith('TEAM'))
|
|
#set($pmap = $utils.toMap($parts))
|
|
#else
|
|
#set($teams = $api.get("tour/${params.id}/team"))
|
|
#set($pmap = $utils.toMap($teams))
|
|
#end
|
|
|
|
## CB TODO - why limit to INDIVIDUAL here?
|
|
#if($tour.type == 'INDIVIDUAL' && $tour.pairing.type == 'MAC_MAHON')
|
|
#set($mmbase = $api.get("tour/${params.id}/standings/0"))
|
|
#if($mmbase.isObject() && ($mmbase.error || $mmbase.message))
|
|
#if($mmbase.error)
|
|
#set($error = $mmbase.error)
|
|
#else
|
|
#set($error = $mmbase.message)
|
|
#end
|
|
<script type="text/javascript">
|
|
onLoad(() => {
|
|
showError("$error")
|
|
});
|
|
</script>
|
|
#set($mmbase = [])
|
|
#end
|
|
#set($mmsMap = $utils.getMmsMap($mmbase))
|
|
#set($mmsPlayersMap = $utils.getMmsPlayersMap($mmbase))
|
|
#end
|
|
|
|
<div class="tab-content" id="registration-tab">
|
|
<div id="reg-view">
|
|
<div id="list-header">
|
|
<div>
|
|
<div id="filter-box" class="ui icon input">
|
|
<input type="text" id="filter" placeholder="Filter..." spellcheck="false"/>
|
|
<i class="circular times link icon"></i>
|
|
</div>
|
|
<select id="reglist-mode" class="ui dropdown">
|
|
<option value="all">Preliminary and final</option>
|
|
<option value="prelim">Preliminary only</option>
|
|
<option value="final">Final only</option>
|
|
</select>
|
|
</div>
|
|
<div id="participation-stats">
|
|
$parts.size() participants, $utils.countFinals($parts) confirmed.
|
|
</div>
|
|
</div>
|
|
|
|
<div id="players-list" class="roundbox">
|
|
<table id="players" class="ui celled selectable striped table">
|
|
<thead>
|
|
<th>Reg</th>
|
|
<th>Name</th>
|
|
<th>First name</th>
|
|
<th>Country</th>
|
|
<th>Club</th>
|
|
##if($tour.country == 'FR')
|
|
## <th>FFG</th>
|
|
##else
|
|
<th>PIN</th>
|
|
##end
|
|
<th>Rank</th>
|
|
## TableSort bug which inverts specified sort...
|
|
<th data-sort-default="1" aria-sort="ascending">Rating</th>
|
|
#if($tour.pairing.type == 'MAC_MAHON')
|
|
<th>MMS</th>
|
|
#end
|
|
<th>Participation</th>
|
|
</thead>
|
|
<tbody>
|
|
#foreach($part in $parts)
|
|
<tr data-id="$part.id" data-text="$esc.html("$part.name.toUpperCase() $part.firstname.toUpperCase() $part.club.toUpperCase()")" class="#if($part.final)final#end">
|
|
<td class="centered reg-status #if($part.final)final#end" data-sort="$!part.final">
|
|
<span class="preliminary"><i class="fa fa-question"></i></span>
|
|
<span class="final"><i class="fa fa-check"></i></span>
|
|
</td>
|
|
<td>$part.name</td>
|
|
<td>$part.firstname</td>
|
|
<td>$part.country.toUpperCase()</td>
|
|
<td>$part.club</td>
|
|
#if($tour.country == 'FR')
|
|
<td>$!part.ffg</td>
|
|
#else
|
|
<td>$!part.egf</td>
|
|
#end
|
|
## display MMS correction on the screen, but not when printed
|
|
<td data-sort="$part.rank">#rank($part.rank)#if($part.mmsCorrection)<span class="noprint"> (#if($part.mmsCorrection > 0)+#end$part.mmsCorrection)</span>#end</td>
|
|
<td>$part.rating</td>
|
|
#if($tour.pairing.type == 'MAC_MAHON')
|
|
<td>$mmsPlayersMap[$part.id]</td>
|
|
#end
|
|
<td class="participating" data-sort="#if($part.skip)$part.skip.size()/part.skip#{else}0#end">
|
|
<div class="participation">
|
|
#foreach($round in [1..$tour.rounds])
|
|
## CB TODO - upstream json parsing should not give longs here, should it?
|
|
#if($part.skip && $part.skip.contains($round.longValue()))
|
|
<label class="ui red label">$round</label>
|
|
#else
|
|
<label class="ui green label">$round</label>
|
|
#end
|
|
#end
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
#end
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="form-actions">
|
|
<button id="add" class="ui blue right labeled icon floating info button">
|
|
<i class="plus icon"></i>
|
|
Add player
|
|
</button>
|
|
#if($tour.type == 'INDIVIDUAL' && $tour.pairing.type == 'MAC_MAHON')
|
|
<button id="edit-macmahon-groups" class="ui right labeled icon floating button">
|
|
<i class="pencil icon"></i>
|
|
Mac Mahon groups
|
|
</button>
|
|
#end
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="player" class="popup">
|
|
<div class="popup-body">
|
|
|
|
<form id="search-form" autocomplete="off" class="ui edit form">
|
|
<div id="search-header" class="five stackable fields">
|
|
#if($tour.country)
|
|
<div class="two wide centered field">
|
|
<div class="toggle">
|
|
<input id="countryFilter" name="countryFilter" type="checkbox" value="$tour.country"/>
|
|
<div class="search-param checkbox">
|
|
<div class="circle"></div>
|
|
</div>
|
|
<label>$tour.country.toUpperCase()</label>
|
|
</div>
|
|
</div>
|
|
#end
|
|
<div class="needle eight wide field">
|
|
<div class="ui icon input">
|
|
<input id="needle" name="needle" type="text" placeholder="Search..." spellcheck="false">
|
|
<i id="clear-search" class="clickable close icon"></i>
|
|
</div>
|
|
</div>
|
|
#* Disabled
|
|
<div class="two wide centered field">
|
|
<div class="toggle">
|
|
<input id="aga" name="aga" type="checkbox" value="true"/>
|
|
<div class="search-param checkbox">
|
|
<div class="circle"></div>
|
|
</div>
|
|
<label>AGA</label>
|
|
</div>
|
|
</div>
|
|
*#
|
|
<div class="two wide centered field">
|
|
<div class="toggle" title="${utils.ratingsDates.egf|'no egf ratings'}">
|
|
<input id="egf" name="egf" type="checkbox" checked value="true"/>
|
|
<div class="search-param checkbox">
|
|
<div class="circle"></div>
|
|
</div>
|
|
<label>EGF</label>
|
|
</div>
|
|
</div>
|
|
<div class="two wide centered field">
|
|
<div class="toggle" title="${utils.ratingsDates.ffg|'no ffg ratings'}">
|
|
<input id="ffg" name="ffg" type="checkbox" checked value="true"/>
|
|
<div class="search-param checkbox">
|
|
<div class="circle"></div>
|
|
</div>
|
|
<label>FFG</label>
|
|
</div>
|
|
</div>
|
|
<div class="two wide centered field">
|
|
<div class="toggle" title="${utils.ratingsDates.ffg|'no ffg ratings'}">
|
|
<input id="browse" name="browse" type="checkbox" value="true"/>
|
|
<div class="search-param checkbox">
|
|
<div class="circle"></div>
|
|
</div>
|
|
<label><i class="sort alphabet down icon"></i></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div id="search-wrapper">
|
|
<div id="search-result"></div>
|
|
</div>
|
|
<form id="player-form" autocomplete="off" class="ui form edit">
|
|
<input type="hidden" name="id"/>
|
|
<input type="hidden" name="egf_id"/>
|
|
<input type="hidden" name="ffg_id"/>
|
|
<!-- input type="hidden" name="aga"/> -->
|
|
<div class="popup-content">
|
|
<div class="player-fields">
|
|
<div class="two stackable fields">
|
|
<div class="eight wide field">
|
|
<label>Family name</label>
|
|
<span class="info"></span>
|
|
<input type="text" name="name" placeholder="last name" spellcheck="false"/>
|
|
</div>
|
|
<div class="eight wide field">
|
|
<label>Given name</label>
|
|
<span class="info"></span>
|
|
<input type="text" name="firstname" placeholder="first name" spellcheck="false"/>
|
|
</div>
|
|
</div>
|
|
<div class="two stackable fields">
|
|
<div class="eight wide field">
|
|
<label>Country</label>
|
|
<span class="info"></span>
|
|
<select name="country">
|
|
<option></option>
|
|
#set($defaultCountry = $translate.defaultCountry[$request.lang])
|
|
#foreach($country in $countries.countries)
|
|
<option value="$country.key">$country.value</option>
|
|
#end
|
|
</select>
|
|
</div>
|
|
<div class="eight wide field">
|
|
<label>Club</label>
|
|
<span class="info"></span>
|
|
<input type="text" name="club" placeholder="club" spellcheck="false"/>
|
|
</div>
|
|
</div>
|
|
<div class="two stackable fields">
|
|
<div class="eight wide field">
|
|
<label>Rating</label>
|
|
<span class="info"></span>
|
|
<input id="rating" name="rating" type="text" class="numeric"/>
|
|
</div>
|
|
<div class="eight wide field">
|
|
<label>Rank<span class="note">initialized from rating</span></label>
|
|
<span class="info"></span>
|
|
<select id="rank" name="rank">
|
|
<option></option>
|
|
#levels()
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="inline fields">
|
|
<label>Final ?</label>
|
|
<div id="final-reg" class="field">
|
|
<input name="final" type="hidden"/>
|
|
<button id="reg-status" type="button" class="ui icon roundedremove mini button">
|
|
<span class="final"><i class="fa fa-check"></i></span>
|
|
<span class="preliminary"><i class="fa fa-question"></i></span>
|
|
</button>
|
|
</div>
|
|
<label>Participation</label>
|
|
#foreach($r in [1..$tour.rounds])
|
|
<div class="active centered field">
|
|
<label for="participation_r${r}">R${r}</label>
|
|
<input id="participation_r${r}" name="r${r}" type="checkbox" checked="checked" class="participation"/>
|
|
</div>
|
|
#end
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="popup-footer">
|
|
<button id="cancel-register" type="button" class="ui gray right labeled icon floating button">
|
|
<i class="times icon"></i>
|
|
<span class="edition">Cancel</span>
|
|
<span class="creation">Close</span>
|
|
</button>
|
|
<button id="unregister" type="button" class="ui red right labeled icon floating button">
|
|
<i class="trash icon"></i>
|
|
Unregister
|
|
</button>
|
|
<button id="register" type="button" class="ui green right labeled icon floating button">
|
|
<i class="plus icon"></i>
|
|
<span class="edition">Update</span>
|
|
<span class="creation">Register</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<div class="success-feedback"><i class="big green check icon"></i></div>
|
|
</div>
|
|
</div>
|
|
#if($tour.type == 'INDIVIDUAL' && $tour.pairing.type == 'MAC_MAHON')
|
|
<div id="macmahon-groups" class="wide popup">
|
|
<div class="popup-body">
|
|
<div class="popup-content">
|
|
#set($underGroup = $mmsMap.get(30 + $tour.pairing.mmBar - 1))
|
|
<div id="under-group" class="multi-select" title="bar-1#if($underGroup && $underGroup.size() > 0), $underGroup.size() players#end">
|
|
#foreach($part in $underGroup)
|
|
<div data-id="$part.id" data-correction="${part.mmsCorrection|0}" class="listitem pairable"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country $part.rating</span></div>
|
|
#end
|
|
</div>
|
|
<div class="pairing-buttons">
|
|
<button id="under-to-top" class="ui blue icon floating button"><i class="angle double right icon"></i></button>
|
|
<button id="top-to-under" class="ui orange icon floating button"><i class="angle double left icon"></i></button>
|
|
</div>
|
|
#set($topGroup = $mmsMap.get(30 + $tour.pairing.mmBar))
|
|
<div id="top-group" class="multi-select" title="bar (top group)#if($topGroup && $topGroup.size() > 0), $topGroup.size() players#end">
|
|
#foreach($part in $topGroup)
|
|
<div data-id="$part.id" data-correction="${part.mmsCorrection|0}" class="listitem pairable"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country $part.rating</span></div>
|
|
#end
|
|
</div>
|
|
<div class="pairing-buttons">
|
|
<button id="top-to-super" class="ui blue icon floating button"><i class="angle double right icon"></i></button>
|
|
<button id="super-to-top" class="ui orange icon floating button"><i class="angle double left icon"></i></button>
|
|
</div>
|
|
#set($superGroup = $mmsMap.get(30 + $tour.pairing.mmBar + 1))
|
|
<div id="super-group" class="multi-select" title="bar+1 (super group)#if($superGroup && $superGroup.size() > 0), $superGroup.size() players#end">
|
|
#foreach($part in $superGroup)
|
|
<div data-id="$part.id" data-correction="${part.mmsCorrection|0}" class="listitem pairable"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country $part.rating</span></div>
|
|
#end
|
|
</div>
|
|
</div>
|
|
<div class="popup-footer">
|
|
<button id="close-macmahon-groups" type="button" class="ui gray right labeled icon floating close button">
|
|
<i class="times icon"></i>
|
|
Close
|
|
</button>
|
|
<button id="reset-macmahon-groups" type="button" class="ui orange right labeled icon floating button">
|
|
<i class="trash icon"></i>
|
|
Reset
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
#end
|
|
<div id="drop-changes" class="hidden">Drop changes?</div>
|
|
<div id="unregister-player" class="hidden">Unregister this player?</div>
|
|
#[[
|
|
<script id="result" type="text/template">
|
|
{{for #data}}
|
|
<div class="result-line" data-index="{{:#getIndex()}}" data-name="{{:name}}">[{{:origin}}{{if origin === 'EGF'}} {{:egf}}{{/if}}] {{:country}} - {{:name}} {{:firstname}} {{:rank}} ({{:club}}) {{if country === 'FR' && license !== 'L'}}<span class="darkred">non licencié</span>{{/if}}</div>
|
|
{{/for}}
|
|
</script>
|
|
<script type="text/javascript" src="/lib/jsrender-1.0.13/jsrender.min.js"></script>
|
|
]]#
|