Persistent dialog state and recap for registration, some fixes for printing pairing
This commit is contained in:
@@ -9,6 +9,8 @@ import com.republicate.kson.Json
|
|||||||
class PairgothTool {
|
class PairgothTool {
|
||||||
fun toMap(array: Json.Array) = array.map { ser -> ser as Json.Object }.associateBy { it.getLong("id")!! }
|
fun toMap(array: Json.Array) = array.map { ser -> ser as Json.Object }.associateBy { it.getLong("id")!! }
|
||||||
|
|
||||||
|
fun countFinals(array: Json.Array) = array.map { ser -> ser as Json.Object }.count { it.getBoolean("final") ?: false }
|
||||||
|
|
||||||
fun getCriteria() = mapOf(
|
fun getCriteria() = mapOf(
|
||||||
"NONE" to "No tie break", // No ranking / tie-break
|
"NONE" to "No tie break", // No ranking / tie-break
|
||||||
|
|
||||||
|
@@ -210,6 +210,24 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui.form .field :invalid {
|
||||||
|
color: #9f3a38;
|
||||||
|
background: #fff6f6;
|
||||||
|
background-image: initial;
|
||||||
|
background-position-x: initial;
|
||||||
|
background-position-y: initial;
|
||||||
|
background-size: initial;
|
||||||
|
background-repeat-x: initial;
|
||||||
|
background-repeat-y: initial;
|
||||||
|
background-attachment: initial;
|
||||||
|
background-origin: initial;
|
||||||
|
background-clip: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.striped.table>tbody>tr:nth-child(2n),.ui.striped.table>tr:nth-child(2n) {
|
||||||
|
background-color: rgba(0,0,50,.1)
|
||||||
|
}
|
||||||
|
|
||||||
.form-actions {
|
.form-actions {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 1em;
|
bottom: 1em;
|
||||||
@@ -385,11 +403,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#title {
|
#title {
|
||||||
font-size: 1rem;
|
font-size: 1rem !important;
|
||||||
margin-top: 0;
|
margin-top: 0.1em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logo, #lang, .steps, #filter-box, #footer, #pairing-left, #pairing-buttons, button, #standings-params {
|
#logo, #lang, .steps, #filter-box, #footer, #pairing-left, #pairing-buttons, button, #standings-params, #logout {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,8 +415,16 @@
|
|||||||
transform: scale(0.7);
|
transform: scale(0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pairing-right {
|
||||||
|
max-width: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
#paired {
|
#paired {
|
||||||
max-height: unset;
|
max-height: unset !important;
|
||||||
|
max-width: unset !important;
|
||||||
|
font-size: 1rem !important;
|
||||||
|
line-height: 1.1rem !important;
|
||||||
|
min-width: 60vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,13 @@
|
|||||||
|
|
||||||
/* registration section */
|
/* registration section */
|
||||||
|
|
||||||
|
#list-header {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 0 1em;
|
||||||
|
}
|
||||||
|
|
||||||
#players-list {
|
#players-list {
|
||||||
max-width: 95vw;
|
max-width: 95vw;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
@@ -229,6 +236,9 @@
|
|||||||
background-color: rgba(100,200,255,200);
|
background-color: rgba(100,200,255,200);
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
&:not(.selected):nth-child(2n) {
|
||||||
|
background-color: rgba(0,0,50,.1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pairables {
|
#pairables {
|
||||||
|
@@ -146,3 +146,4 @@ to à
|
|||||||
unpairable players joueurs non disponibles
|
unpairable players joueurs non disponibles
|
||||||
version 0.1 supports the version 0.1 supporte le système d’appariement
|
version 0.1 supports the version 0.1 supporte le système d’appariement
|
||||||
white vs. black blanc vs. Noir
|
white vs. black blanc vs. Noir
|
||||||
|
confirmed. confirmé(s).
|
@@ -161,6 +161,7 @@ function modal(id) {
|
|||||||
function close_modal() {
|
function close_modal() {
|
||||||
$('body').removeClass('dimmed');
|
$('body').removeClass('dimmed');
|
||||||
$(`.popup`).removeClass('shown');
|
$(`.popup`).removeClass('shown');
|
||||||
|
store('addingPlayers', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFile(blob, filename) {
|
function downloadFile(blob, filename) {
|
||||||
|
@@ -84,6 +84,26 @@ function fillPlayer(player) {
|
|||||||
$('#register').focus();
|
$('#register').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addPlayers() {
|
||||||
|
let form = $('#player-form')[0];
|
||||||
|
form.addClass('add');
|
||||||
|
// keep preliminary/final status
|
||||||
|
let status = form.val('final') || false;
|
||||||
|
form.reset();
|
||||||
|
// initial search checkboxes position
|
||||||
|
['countryFilter', 'aga', 'egf', 'ffg'].forEach(id => {
|
||||||
|
let value = store(id);
|
||||||
|
if (value !== null && typeof(value) !== 'undefined') {
|
||||||
|
$(`#${id}`)[0].checked = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
form.val('final', status);
|
||||||
|
$('#player').removeClass('edit').addClass('create');
|
||||||
|
modal('player');
|
||||||
|
$('#needle').focus();
|
||||||
|
store('addingPlayers', true);
|
||||||
|
}
|
||||||
|
|
||||||
let tableSort;
|
let tableSort;
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
@@ -125,22 +145,7 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#add').on('click', e => {
|
$('#add').on('click', e => {
|
||||||
let form = $('#player-form')[0];
|
addPlayers();
|
||||||
form.addClass('add');
|
|
||||||
// keep preliminary/final status
|
|
||||||
let status = form.val('final') || false;
|
|
||||||
form.reset();
|
|
||||||
// initial search checkboxes position
|
|
||||||
['countryFilter', 'aga', 'egf', 'ffg'].forEach(id => {
|
|
||||||
let value = store(id);
|
|
||||||
if (value !== null && typeof(value) !== 'undefined') {
|
|
||||||
$(`#${id}`)[0].checked = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
form.val('final', status);
|
|
||||||
$('#player').removeClass('edit').addClass('create');
|
|
||||||
modal('player');
|
|
||||||
$('#needle').focus();
|
|
||||||
});
|
});
|
||||||
$('#cancel-register').on('click', e => {
|
$('#cancel-register').on('click', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -309,4 +314,7 @@ onLoad(() => {
|
|||||||
$('#filter')[0].value = '';
|
$('#filter')[0].value = '';
|
||||||
$('tbody > tr').removeClass('hidden');
|
$('tbody > tr').removeClass('hidden');
|
||||||
});
|
});
|
||||||
|
if (store('addingPlayers')) {
|
||||||
|
addPlayers();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@@ -1,15 +1,18 @@
|
|||||||
|
#set($parts = $api.get("tour/${params.id}/part"))
|
||||||
|
#set($pmap = $utils.toMap($parts))
|
||||||
<div class="tab-content" id="registration-tab">
|
<div class="tab-content" id="registration-tab">
|
||||||
<div id="reg-view">
|
<div id="reg-view">
|
||||||
<div>
|
<div id="list-header">
|
||||||
<div id="filter-box" class="ui icon input">
|
<div id="filter-box" class="ui icon input">
|
||||||
<input type="text" id="filter" placeholder="Search..."/>
|
<input type="text" id="filter" placeholder="Search..."/>
|
||||||
<i class="circular times link icon"></i>
|
<i class="circular times link icon"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
$parts.size() participants, $utils.countFinals($parts) confirmed.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="players-list" class="roundbox">
|
<div id="players-list" class="roundbox">
|
||||||
#set($parts = $api.get("tour/${params.id}/part"))
|
|
||||||
#set($pmap = $utils.toMap($parts))
|
|
||||||
<table id="players" class="ui celled selectable striped table">
|
<table id="players" class="ui celled selectable striped table">
|
||||||
<thead>
|
<thead>
|
||||||
<th>Reg</th>
|
<th>Reg</th>
|
||||||
@@ -175,7 +178,7 @@
|
|||||||
<button id="cancel-register" type="button" class="ui gray right labeled icon floating close button">
|
<button id="cancel-register" type="button" class="ui gray right labeled icon floating close button">
|
||||||
<i class="times icon"></i>
|
<i class="times icon"></i>
|
||||||
<span class="edition">Close</span>
|
<span class="edition">Close</span>
|
||||||
<span class="creation">Cancel</span>
|
<span class="creation">Close</span>
|
||||||
</button>
|
</button>
|
||||||
<button id="unregister" type="button" class="ui red right labeled icon floating button">
|
<button id="unregister" type="button" class="ui red right labeled icon floating button">
|
||||||
<i class="trash icon"></i>
|
<i class="trash icon"></i>
|
||||||
|
Reference in New Issue
Block a user