finishings on the pairing page

This commit is contained in:
Claude Brisson
2023-12-28 09:18:16 +01:00
parent 149541cb3c
commit 83b9194b48
7 changed files with 74 additions and 29 deletions

View File

@@ -216,6 +216,9 @@
display: flex;
flex-flow: row wrap;
justify-content: space-between;
&.right {
justify-content: flex-end;
}
}
input[type="number"] {
@@ -317,6 +320,11 @@
border-radius: 5px;
overflow-x: hidden;
overflow-y: auto;
.popup-header {
text-align: center;
font-size: 1.5em;
margin-bottom: 1em;
}
.popup-content {
display: flex;
flex-direction: column;

View File

@@ -209,8 +209,14 @@
flex-flow: column nowrap;
min-height: 10vh;
max-height: 30vh;
min-width: 50vw;
}
#pairing-right {
display: inline-flex;
flex-flow: row wrap;
gap: 1em;
}
.choose-round.button {
padding: 0.2em 0.8em;
}

View File

@@ -191,13 +191,11 @@ onLoad(() => {
document.on('keyup', e => {
switch (e.key) {
case 'Escape': {
if ($('#player').hasClass('shown')) {
if ($('#needle')[0].value) {
if ($('#player').hasClass('shown') && $('#needle')[0].value) {
$('#needle')[0].value = '';
initSearch();
} else {
close_modal();
}
} else {
close_modal();
}
break;
}

View File

@@ -51,6 +51,7 @@ onLoad(()=>{
$('#unpair').on('click', e => {
let games = $('#paired')[0].childNodes.filter('.selected.listitem').map(item => parseInt(item.data("id")));
if (games.length == 0) {
$('#paired .listitem').addClass('selected');
games = $('#paired')[0].childNodes.filter('.selected.listitem').map(item => parseInt(item.data("id")));
}
unpair(games);

View File

@@ -39,4 +39,10 @@ onLoad(() => {
e.preventDefault();
return false;
});
$('#publish').on('click', e => {
modal('publish-modal');
});
$('#publish-modal').on('click', e => {
close_modal();
});
});

View File

@@ -22,35 +22,39 @@
<button class="ui floating choose-round next-round button">&raquo;</button>
</div>
<div id="pairing-lists">
<div id="pairables" class="multi-select" title="pairable players">
<div id="pairing-left">
<div id="pairables" class="multi-select" title="pairable players">
#foreach($p in $pairables)
#set($part = $pmap[$p])
<div data-id="$part.id" class="listitem pairable"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country</span></div>
<div data-id="$part.id" class="listitem pairable"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country</span></div>
#end
</div>
<div id="pairing-buttons">
<button id="pair" class="ui blue right labeled icon floating button">
<i class="angle double right icon"></i>
Pair
</button>
<button id="unpair" class="ui orange right labeled icon floating button">
<i class="angle double left icon"></i>
Unpair
</button>
</div>
<div id="paired" class="multi-select" title="white vs. black">
#foreach($game in $games)
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
<div class="listitem game" data-id="$game.id"><span class="table">#$game.t</span><span class="white">#if($white)$white.name $white.firstname #rank($white.rank)#{else}BIP#end</span><span>&nbsp;</span><span class="black">#if($black)$black.name $black.firstname #rank($black.rank)#{else}BIP#end</span>#if($game.h)<span class="handicap">h$game.h</span>#end</div>
#end
</div>
</div>
<div id="unpairables" class="multi-select" title="unpairable players">
</div>
<div id="unpairables" class="multi-select" title="unpairable players">
#foreach($p in $unpairables)
#set($part = $pmap[$p])
<div class="listitem unpairable" data-id="$part.id"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country</span></div>
<div class="listitem unpairable" data-id="$part.id"><span>$part.name $part.firstname</span><span>#rank($part.rank) $part.country</span></div>
#end
</div>
</div>
<div id="pairing-right">
<div id="pairing-buttons">
<button id="pair" class="ui blue right labeled icon floating button">
<i class="angle double right icon"></i>
Pair
</button>
<button id="unpair" class="ui orange right labeled icon floating button">
<i class="angle double left icon"></i>
Unpair
</button>
</div>
<div id="paired" class="multi-select" title="white vs. black">
#foreach($game in $games)
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
<div class="listitem game" data-id="$game.id"><span class="table">#$game.t</span><span class="white">#if($white)$white.name $white.firstname #rank($white.rank)#{else}BIP#end</span><span>&nbsp;</span><span class="black">#if($black)$black.name $black.firstname #rank($black.rank)#{else}BIP#end</span>#if($game.h)<span class="handicap">h$game.h</span>#end</div>
#end
</div>
</div>
</div>
</div>
</div>

View File

@@ -87,4 +87,26 @@
</tbody>
</table>
</div>
<div class="right form-actions">
<button id="publish" class="ui yellow floating button">Publish</button>
</div>
</div>
<div id="publish-modal" class="popup">
<div class="popup-body">
<div class="popup-header">
Download Standings
</div>
<div class="popup-content">
Choose format
</div>
<div class="popup-footer">
<div class="form-actions">
<button class="ui gray floating cancel button">Cancel</button>
<button class="ui blue floating button">EGF</button>
<button class="ui blue floating button">FFG</button>
<button class="ui blue floating button">PDF</button>
<button class="ui blue floating button">HTML</button>
</div>
</div>
</div>
</div>