Registration and fuzzy search in progress

This commit is contained in:
Claude Brisson
2023-12-15 13:45:23 +01:00
parent 519eca8af3
commit ea44f6068e
26 changed files with 708 additions and 102 deletions

View File

@@ -36,13 +36,6 @@
</div>
<div id="lang">
<i class="$translate.flags[$request.lang] flag"></i>
<div id="lang-list">
#foreach($lang in $translate.flags.entrySet())
#if($lang != $request.lang)
<a class="lang" data-lang="$lang.key" href="#"><i class="$lang.value flag"></i>&nbsp;$lang.key</a>
#end
#end
</div>
</div>
</div>
<div id="center">
@@ -60,8 +53,17 @@
</div>
<div id="backdrop"></div>
<div id="dimmer"></div>
<div id="lang-list">
#foreach($lang in $translate.flags.entrySet())
#if($lang != $request.lang)
<a class="lang" data-lang="$lang.key" href="#"><i class="$lang.value flag"></i>&nbsp;$lang.key</a>
#end
#end
</div>
<script type="text/javascript" src="/lib/store2-2.14.2.min.js"></script>
<script type="text/javascript" src="/lib/tablesort-5.4.0.min.js"></script>
<script type="text/javascript" src="/lib/tablesort-5.4.0/tablesort.min.js"></script>
<script type="text/javascript" src="/lib/tablesort-5.4.0/sorts/tablesort.number.min.js"></script>
<link rel="stylesheet" href="/lib/tablesort-5.4.0/tablesort.css"/>
<script type="text/javascript" src="/lib/imaskjs-7.1.3/imask.min.js"></script>
<script type="text/javascript" src="/js/api.js"></script>
<script type="text/javascript" src="/js/main.js"></script>

View File

@@ -65,6 +65,12 @@
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet>
<servlet-name>search</servlet-name>
<servlet-class>org.jeudego.pairgoth.web.SearchServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<!-- servlet mappings -->
<servlet-mapping>
@@ -77,7 +83,11 @@
</servlet-mapping>
<servlet-mapping>
<servlet-name>api</servlet-name>
<url-pattern>/api/*</url-pattern>
<url-pattern>/api/tour/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>search</servlet-name>
<url-pattern>/api/search/*</url-pattern>
</servlet-mapping>
<!-- context params -->

View File

@@ -105,7 +105,8 @@ Element.prototype.modal = function(show) {
/* DOM helpers */
HTMLFormElement.prototype.val = function(name) {
HTMLFormElement.prototype.val = function(name, value) {
let hasValue = typeof(value) !== 'undefined';
let ctl = this.find(`[name="${name}"]`)[0];
if (!ctl) {
console.error(`unknown input name: ${name}`)
@@ -113,15 +114,30 @@ HTMLFormElement.prototype.val = function(name) {
let tag = ctl.tagName;
let type = tag === 'INPUT' ? ctl.attr('type') : undefined;
if (
(tag === 'INPUT' && ['text', 'number'].includes(ctl.attr('type'))) ||
(tag === 'INPUT' && ['text', 'number', 'hidden'].includes(ctl.attr('type'))) ||
tag === 'SELECT'
) {
return ctl.value;
if (hasValue) {
ctl.value = value;
return;
}
else return ctl.value;
} else if (tag === 'INPUT' && ctl.attr('type') === 'radio') {
ctl = $(`input[name="${name}"]:checked`)[0];
if (ctl) return ctl.value;
if (hasValue) {
ctl = $(`input[name="${name}"][value="${value}"]`);
if (ctl) ctl.checked = true;
return;
} else {
ctl = $(`input[name="${name}"]:checked`);
if (ctl) return ctl[0].value;
else return null;
}
} else if (tag === 'INPUT' && ctl.attr('type') === 'checkbox') {
return ctl.checked;
if (hasValue) {
ctl.checked = value !== 'false' && Boolean(value);
return;
}
else return ctl.checked;
}
console.error(`unhandled input tag or type for input ${name} (tag: ${tag}, type:${type}`);
return null;
@@ -142,6 +158,11 @@ function modal(id) {
$(`#${id}.popup`).addClass('shown');
}
function close_modal() {
$('body').removeClass('dimmed');
$(`.popup`).removeClass('shown');
}
onLoad(() => {
$('button.close').on('click', e => {
let modal = e.target.closest('.popup');

View File

@@ -5,8 +5,23 @@ onLoad(() => {
min: 0,
max: 4000
});
new Tablesort($('#players')[0]);
$('#add').on('click', e => {
let form = $('#player-form')[0];
form.addClass('add');
// $('#player-form input.participation').forEach(chk => chk.checked = true);
form.reset();
modal('player');
});
$('#cancel-register').on('click', e => {
e.preventDefault();
close_modal();
return false;
});
$('#register').on('click', e => {
let form = e.target.closest('form');
let valid = true;
let required = ['name', 'firstname', 'country', 'club', 'rank', 'rating'];
for (let name of required) {
let ctl = form.find(`[name=${name}]`)[0];
@@ -29,15 +44,65 @@ onLoad(() => {
rating: form.val('rating'),
rank: form.val('rank'),
country: form.val('country'),
club: form.val('club')
club: form.val('club'),
skip: form.find('input.participation').map((input,i) => [i+1, input.checked]).filter(arr => !arr[1]).map(arr => arr[0])
}
console.log(player);
api.postJson(`tour/${tour_id}/part`, player)
if (form.hasClass('add')) {
api.postJson(`tour/${tour_id}/part`, player)
.then(player => {
console.log(player)
if (player !== 'error') {
window.location.reload();
}
});
} else {
let id = form.val('id');
player['id'] = id;
api.putJson(`tour/${tour_id}/part/${id}`, player)
.then(player => {
console.log(player)
if (player !== 'error') {
window.location.reload();
}
});
}
});
$('#players > tbody > tr').on('click', e => {
let id = e.target.closest('tr').attr('data-id');
api.getJson(`tour/${tour_id}/part/${id}`)
.then(player => {
console.log(player)
if (player !== 'error') {
window.location.reload();
let form = $('#player-form')[0];
form.val('id', player.id);
form.val('name', player.name);
form.val('firstname', player.firstname);
form.val('rating', player.rating);
form.val('rank', player.rank);
form.val('country', player.country);
form.val('club', player.club);
for (r = 1; r <= tour_rounds; ++r) {
form.val(`r${r}`, !(player.skip && player.skip.includes(r)));
}
form.removeClass('add');
modal('player');
}
});
});
$('#needle').on('input', e => {
let needle = $('#needle')[0].value;
if (needle && needle.length > 2) {
let form = $('#player-form')[0];
let search = {
needle: needle,
aga: form.val('aga'),
egf: form.val('egf'),
ffg: form.val('ffg')
}
api.postJson('search', search)
.then(result => {
console.log(result);
})
} else $('#search-result').addClass('hidden');
});
});

View File

@@ -0,0 +1,6 @@
/*!
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2023 ; Licensed MIT
*/
!function(){function r(e){return e=(e=e.replace(/\-/g,"/")).replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2,4})/,"$3-$2-$1"),new Date(e).getTime()||-1}Tablesort.extend("date",function(e){return(-1!==e.search(/(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\.?\,?\s*/i)||-1!==e.search(/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/)||-1!==e.search(/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i))&&!isNaN(r(e))},function(e,n){return e=e.toLowerCase(),n=n.toLowerCase(),r(n)-r(e)})}();

View File

@@ -0,0 +1,6 @@
/*!
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2023 ; Licensed MIT
*/
Tablesort.extend("dotsep",function(t){return/^(\d+\.)+\d+$/.test(t)},function(t,r){t=t.split("."),r=r.split(".");for(var e,n,i=0,s=t.length;i<s;i++)if((e=parseInt(t[i],10))!==(n=parseInt(r[i],10))){if(n<e)return-1;if(e<n)return 1}return 0});

View File

@@ -0,0 +1,6 @@
/*!
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2023 ; Licensed MIT
*/
!function(){function r(t){return t=t.match(/^(\d+(\.\d+)?) ?((K|M|G|T|P|E|Z|Y|B$)i?B?)$/i),parseFloat(t[1].replace(/[^\-?0-9.]/g,""))*function(t){var e="i"===(t=t.toLowerCase())[1]?1024:1e3;switch(t[0]){case"k":return Math.pow(e,2);case"m":return Math.pow(e,3);case"g":return Math.pow(e,4);case"t":return Math.pow(e,5);case"p":return Math.pow(e,6);case"e":return Math.pow(e,7);case"z":return Math.pow(e,8);case"y":return Math.pow(e,9);default:return e}}(t[3])}Tablesort.extend("filesize",function(t){return/^\d+(\.\d+)? ?(K|M|G|T|P|E|Z|Y|B$)i?B?$/i.test(t)},function(t,e){return t=r(t),e=r(e),e=e,t=t,e=parseFloat(e),t=parseFloat(t),(e=isNaN(e)?0:e)-(t=isNaN(t)?0:t)})}();

View File

@@ -0,0 +1,6 @@
/*!
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2023 ; Licensed MIT
*/
Tablesort.extend("monthname",function(e){return-1!==e.search(/(January|February|March|April|May|June|July|August|September|October|November|December)/i)},function(e,r){var u=["January","February","March","April","May","June","July","August","September","October","November","December"];return u.indexOf(r)-u.indexOf(e)});

View File

@@ -0,0 +1,6 @@
/*!
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2023 ; Licensed MIT
*/
!function(){function e(t){return t.replace(/[^\-?0-9.]/g,"")}Tablesort.extend("number",function(t){return t.match(/^[-+]?[£\x24Û¢´€]?\d+\s*([,\.]\d{0,2})/)||t.match(/^[-+]?\d+\s*([,\.]\d{0,2})?[£\x24Û¢´€]/)||t.match(/^[-+]?(\d)*-?([,\.]){0,1}-?(\d)+([E,e][\-+][\d]+)?%?$/)},function(t,n){return t=e(t),n=e(n),n=n,t=t,n=parseFloat(n),t=parseFloat(t),(n=isNaN(n)?0:n)-(t=isNaN(t)?0:t)})}();

View File

@@ -0,0 +1,33 @@
th[role=columnheader]:not(.no-sort) {
cursor: pointer;
}
th[role=columnheader]:not(.no-sort):after {
content: '';
float: right;
margin-top: 7px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #404040 transparent;
visibility: hidden;
opacity: 0;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
th[aria-sort=ascending]:not(.no-sort):after {
border-bottom: none;
border-width: 4px 4px 0;
}
th[aria-sort]:not(.no-sort):after {
visibility: visible;
opacity: 0.4;
}
th[role=columnheader]:not(.no-sort):hover:after {
visibility: visible;
opacity: 1;
}

View File

@@ -1,6 +1,6 @@
/*!
* tablesort v5.4.0 (2022-04-27)
* tablesort v5.4.0 (2023-05-04)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2022 ; Licensed MIT
* Copyright (c) 2023 ; Licensed MIT
*/
!function(){function r(t,e){if(!(this instanceof r))return new r(t,e);if(!t||"TABLE"!==t.tagName)throw new Error("Element must be a table");this.init(t,e||{})}function m(t){var e;return window.CustomEvent&&"function"==typeof window.CustomEvent?e=new CustomEvent(t):(e=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,void 0),e}function p(t,e){return t.getAttribute(e.sortAttribute||"data-sort")||t.textContent||t.innerText||""}function v(t,e){return(t=t.trim().toLowerCase())===(e=e.trim().toLowerCase())?0:t<e?1:-1}function A(t,e){return[].slice.call(t).find(function(t){return t.getAttribute("data-sort-column-key")===e})}function E(n,o){return function(t,e){var r=n(t.td,e.td);return 0===r?o?e.index-t.index:t.index-e.index:r}}var x=[];r.extend=function(t,e,r){if("function"!=typeof e||"function"!=typeof r)throw new Error("Pattern and sort must be a function");x.push({name:t,pattern:e,sort:r})},r.prototype={init:function(t,e){var r,n,o,i=this;if(i.table=t,i.thead=!1,i.options=e,t.rows&&0<t.rows.length)if(t.tHead&&0<t.tHead.rows.length){for(a=0;a<t.tHead.rows.length;a++)if("thead"===t.tHead.rows[a].getAttribute("data-sort-method")){r=t.tHead.rows[a];break}r=r||t.tHead.rows[t.tHead.rows.length-1],i.thead=!0}else r=t.rows[0];if(r){function s(){i.current&&i.current!==this&&i.current.removeAttribute("aria-sort"),i.current=this,i.sortTable(this)}for(var a=0;a<r.cells.length;a++)(o=r.cells[a]).setAttribute("role","columnheader"),"none"!==o.getAttribute("data-sort-method")&&(o.tabindex=0,o.addEventListener("click",s,!1),null!==o.getAttribute("data-sort-default")&&(n=o));n&&(i.current=n,i.sortTable(n))}},sortTable:function(t,e){var r=this,n=t.getAttribute("data-sort-column-key"),o=t.cellIndex,i=v,s="",a=[],d=r.thead?0:1,u=t.getAttribute("data-sort-method"),l=t.getAttribute("aria-sort");if(r.table.dispatchEvent(m("beforeSort")),e||(l="ascending"===l||"descending"!==l&&r.options.descending?"descending":"ascending",t.setAttribute("aria-sort",l)),!(r.table.rows.length<2)){if(!u){for(;a.length<3&&d<r.table.tBodies[0].rows.length;)0<(s=(s=(f=n?A(r.table.tBodies[0].rows[d].cells,n):r.table.tBodies[0].rows[d].cells[o])?p(f,r.options):"").trim()).length&&a.push(s),d++;if(!a)return}for(d=0;d<x.length;d++)if(s=x[d],u){if(s.name===u){i=s.sort;break}}else if(a.every(s.pattern)){i=s.sort;break}for(r.col=o,d=0;d<r.table.tBodies.length;d++){var c,f,h=[],b={},w=0,g=0;if(!(r.table.tBodies[d].rows.length<2)){for(c=0;c<r.table.tBodies[d].rows.length;c++)"none"===(s=r.table.tBodies[d].rows[c]).getAttribute("data-sort-method")?b[w]=s:(f=n?A(s.cells,n):s.cells[r.col],h.push({tr:s,td:f?p(f,r.options):"",index:w})),w++;for("descending"===l?h.sort(E(i,!0)):(h.sort(E(i,!1)),h.reverse()),c=0;c<w;c++)b[c]?(s=b[c],g++):s=h[c-g].tr,r.table.tBodies[d].appendChild(s)}}r.table.dispatchEvent(m("afterSort"))}},refresh:function(){void 0!==this.current&&this.sortTable(this.current,!0)}},"undefined"!=typeof module&&module.exports?module.exports=r:window.Tablesort=r}();

View File

@@ -57,14 +57,14 @@
<label>Tournament type</label>
<span class="info"></span>
<select name="type">
<option value="INDIVIDUAL" #if(!$tour || $tour.type == 'INDIVIDUAL') checked #end>Individual players</option>
<option value="PAIRGO" #if($tour && $tour.type == 'PAIRGO') checked #end>Pair-go tournament</option>
<option value="RENGO2" #if($tour && $tour.type == 'RENGO2') checked #end>Rengo with 2 players teams</option>
<option value="RENGO3" #if($tour && $tour.type == 'RENGO3') checked #end>Rengo with 3 players team</option>
<option value="TEAM2" #if($tour && $tour.type == 'TEAM2') checked #end>Team of 2 individual players</option>
<option value="TEAM3" #if($tour && $tour.type == 'TEAM3') checked #end>Team of 3 individual players</option>
<option value="TEAM4" #if($tour && $tour.type == 'TEAM4') checked #end>Team of 4 individual players</option>
<option value="TEAM5" #if($tour && $tour.type == 'TEAM5') checked #end>Team of 5 individual players</option>
<option value="INDIVIDUAL" #if(!$tour || $tour.type == 'INDIVIDUAL') selected #end>Individual players</option>
<option value="PAIRGO" #if($tour && $tour.type == 'PAIRGO') selected #end>Pair-go tournament</option>
<option value="RENGO2" #if($tour && $tour.type == 'RENGO2') selected #end>Rengo with 2 players teams</option>
<option value="RENGO3" #if($tour && $tour.type == 'RENGO3') selected #end>Rengo with 3 players team</option>
<option value="TEAM2" #if($tour && $tour.type == 'TEAM2') selected #end>Team of 2 individual players</option>
<option value="TEAM3" #if($tour && $tour.type == 'TEAM3') selected #end>Team of 3 individual players</option>
<option value="TEAM4" #if($tour && $tour.type == 'TEAM4') selected #end>Team of 4 individual players</option>
<option value="TEAM5" #if($tour && $tour.type == 'TEAM5') selected #end>Team of 5 individual players</option>
</select>
</div>
<div class="four wide field">
@@ -78,9 +78,9 @@
<label>Pairing</label>
<span class="info"></span>
<select name="pairing">
<option value="MAC_MAHON" #if(!$tour || $tour.pairing.type == 'MAC_MAHON') checked #end>Mac Mahon</option>
<option value="SWISS" #if($tour && $tour.pairing.type == 'SWISS') checked #end>Swiss</option>
<option value="ROUND_ROBIN" #if($tour && $tour.pairing.type == 'ROUND_ROBIN') checked #end>Round-robin</option>
<option value="MAC_MAHON" #if(!$tour || $tour.pairing.type == 'MAC_MAHON') selected #end>Mac Mahon</option>
<option value="SWISS" #if($tour && $tour.pairing.type == 'SWISS') selected #end>Swiss</option>
<option value="ROUND_ROBIN" #if($tour && $tour.pairing.type == 'ROUND_ROBIN') selected #end>Round-robin</option>
</select>
</div>
#* MM floor parameter not shown on creation page
@@ -117,24 +117,24 @@
#levels($limit)
</select>
</div>
</div>
<div class="swiss pairing four wide field #if(!$tour || $tour && $tour.pairing.type != 'SWISS') hidden #end">
<label>1st round seeding</label>
<span class="info"></span>
<select name="firstSeed">
<option value="SPLIT_AND_FOLD" #if($tour && "$!tour.pairing.main.firstSeed" == "SPLIT_AND_FOLD") selected #end>Split and fold</option>
<option value="SPLIT_AND_RANDOM" #if(!$tour || "$!tour.pairing.main.firstSeed" == "SPLIT_AND_RANDOM") selected #end>Split and random</option>
<option value="SPLIT_AND_SLIP" #if($tour && "$!tour.pairing.main.firstSeed" == "SPLIT_AND_SLIP") selected #end>Split and slip</option>
</select>
</div>
<div class="swiss pairing four wide field #if(!$tour || $tour && $tour.pairing.type != 'SWISS')hidden#end">
<label>Next rounds seeding</label>
<span class="info"></span>
<select name="secondSeed">
<option value="SPLIT_AND_FOLD" #if(!$tour || "$!tour.pairing.main.secondSeed" == "SPLIT_AND_FOLD") selected #end>Split and fold</option>
<option value="SPLIT_AND_RANDOM" #if($tour && "$!tour.pairing.main.secondSeed" == "SPLIT_AND_RANDOM") selected #end>Split and random</option>
<option value="SPLIT_AND_SLIP" #if($tour && "$!tour.pairing.main.secondSeed" == "SPLIT_AND_SLIP") selected #end>Split and slip</option>
</select>
<div class="swiss pairing six wide field #if(!$tour || $tour && $tour.pairing.type != 'SWISS') hidden #end">
<label>1st round seeding</label>
<span class="info"></span>
<select name="firstSeed">
<option value="SPLIT_AND_FOLD" #if($tour && "$!tour.pairing.main.firstSeed" == "SPLIT_AND_FOLD") selected #end>Split and fold</option>
<option value="SPLIT_AND_RANDOM" #if(!$tour || "$!tour.pairing.main.firstSeed" == "SPLIT_AND_RANDOM") selected #end>Split and random</option>
<option value="SPLIT_AND_SLIP" #if($tour && "$!tour.pairing.main.firstSeed" == "SPLIT_AND_SLIP") selected #end>Split and slip</option>
</select>
</div>
<div class="swiss pairing six wide field #if(!$tour || $tour && $tour.pairing.type != 'SWISS')hidden#end">
<label>Next rounds seeding</label>
<span class="info"></span>
<select name="secondSeed">
<option value="SPLIT_AND_FOLD" #if(!$tour || "$!tour.pairing.main.secondSeed" == "SPLIT_AND_FOLD") selected #end>Split and fold</option>
<option value="SPLIT_AND_RANDOM" #if($tour && "$!tour.pairing.main.secondSeed" == "SPLIT_AND_RANDOM") selected #end>Split and random</option>
<option value="SPLIT_AND_SLIP" #if($tour && "$!tour.pairing.main.secondSeed" == "SPLIT_AND_SLIP") selected #end>Split and slip</option>
</select>
</div>
</div>
</div>
<div class="roundbox">

View File

@@ -2,7 +2,39 @@
<div id="reg-view">
<div id="players-list" class="roundbox">
#set($parts = $api.get("tour/${params.id}/part"))
$parts
<table id="players" class="ui celled selectable striped table">
<thead>
<th>name</th>
<th>first name</th>
<th>country</th>
<th>club</th>
<th>rank</th>
<th>rating</th>
<th>participation</th>
</thead>
<tbody>
#foreach($part in $parts)
<tr data-id="$part.id">
<td>$part.name</td>
<td>$part.firstname</td>
<td>$part.country</td>
<td>$part.club</td>
<td data-sort="$part.rank">#rank($part.rank)</td>
<td>$part.rating</td>
<td>
#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 circular label">$round</label>
#else
<label class="ui green circular label">$round</label>
#end
#end
</td>
</tr>
#end
</tbody>
</table>
</div>
<div class="form-actions">
<button id="add" class="ui blue right labeled icon floating info button">
@@ -15,35 +47,37 @@ $parts
<div id="player" class="popup">
<div class="popup-body">
<form id="player-form" class="ui form edit">
<input type="hidden" name="id"/>
<div class="popup-content">
<div class="four stackable fields">
<div id="search-form" class="four stackable fields">
<div class="twelve wide field">
<div class="ui icon input">
<input type="text" placeholder="Search...">
<input id="needle" name="needle" type="text" placeholder="Search...">
<i class="search icon"></i>
</div>
</div>
<div class="two wide field">
<div class="active checkbox">
<div class="circle"></div>
<input type="checkbox" class="hidden" checked/>
<input name="aga" type="checkbox" class="hidden" checked/>
</div>
AGA
</div>
<div class="two wide field">
<div class="active checkbox">
<div class="circle"></div>
<input type="checkbox" class="hidden" checked/>
<input name="egf" type="checkbox" class="hidden" checked/>
</div>
EGF
</div>
<div class="two wide field">
<div class="active checkbox">
<div class="circle"></div>
<input type="checkbox" class="hidden" checked/>
<input name="ffg" type="checkbox" class="hidden" checked/>
</div>
FFG
</div>
<div id="search-result" class="hidden">hophop</div>
</div>
<div class="two stackable fields">
<div class="eight wide field">
@@ -90,9 +124,18 @@ $parts
<input name="rating" type="text" class="numeric"/>
</div>
</div>
<div class="inline fields">
<label>Participation</label>
#foreach($r in [1..$tour.rounds])
<div class="centered field">
<label>R${r}</label>
<input name="r${r}" type="checkbox" checked="checked" class="participation"/>
</div>
#end
</div>
</div>
<div class="popup-footer">
<button class="ui gray right labeled icon floating close button">
<button id="cancel-register" class="ui gray right labeled icon floating close button">
<i class="times icon"></i>
Cancel
</button>
@@ -104,10 +147,3 @@ $parts
</form>
</div>
</div>
<script type="text/javascript">
onLoad(() => {
$('#add').on('click', e => {
modal('player');
});
});
</script>

View File

@@ -11,6 +11,7 @@
<option value="$k" #if($sel && $sel == $k)selected#end>$disp</option>
#end
#end
#macro(rank $rank)#if( $rank<0 )#set( $k = -$rank )${k}k#else#set( $d=$rank+1 )${d}d#end#end
#if($params.id)
#set($tour = $api.get("tour/${params.id}"))
#if (!$tour)
@@ -63,6 +64,7 @@
<script type="text/javascript">
#if($tour)
const tour_id = ${tour.id};
const tour_rounds = ${tour.rounds};
#end
#set($datepickerLocale = $translate.datepickerLocale($request.lang, $request.loc))
const datepickerLocale = '$datepickerLocale';