Skip to content
Snippets Groups Projects
Commit 08b5bef2 authored by ForkBench's avatar ForkBench
Browse files

Loading stage and competition in case.

parent feb06530
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ table {
}
th,
td {
.el {
margin: 3px;
padding-left: 20px;
text-align: left;
......@@ -128,24 +128,24 @@ tr {
border-radius: 20px;
}
td:first-child,
.first,
th:first-child {
border-left: none;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
}
td:last-child,
.last,
th:last-child {
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
}
tr:nth-child(even) {
tr:nth-child(even) .el {
background-color: #e9ecef;
}
tr:nth-child(odd) {
tr:nth-child(odd) .el {
background-color: #dee2e6;
}
......
......@@ -32,6 +32,21 @@
loadPlayers();
});
// Lod the stage and competition
async function loadStageAndCompetition() {
if (competition === undefined) {
return;
}
await Session.GetCompetition(competition.CompetitionID).then(
(result) => {
if (result !== null) {
SelectedCompetition.set(result);
}
}
);
}
// Load the players from the selected competition
async function loadPlayers() {
if (competition === undefined) {
......@@ -193,8 +208,24 @@
>
<td>
<!-- TODO: input checkbox -->
<!-- <input
type="checkbox"
checked={player.PlayerPresent}
on:change={async () => {
player.PlayerPresent =
!player.PlayerPresent;
if (competition != undefined)
await Session.UpdateCompetitionPlayer(
competition.CompetitionID,
player
).then(() => {
loadPlayers();
});
}}
/> -->
</td>
<td
class="el first"
on:dblclick={async () => {
// Show a prompt to the user to change the rank
let newRank = await swal({
......@@ -239,6 +270,7 @@
}}>{player.PlayerInitialRank}</td
>
<td
class="el"
on:dblclick={async () => {
// Show a prompt to the user to change the lastname
let newLastname = await swal({
......@@ -270,6 +302,7 @@
>{player.PlayerLastname.toLocaleUpperCase()}</td
>
<td
class="el"
on:dblclick={async () => {
// Show a prompt to the user to change the firstname
let newFirstname = await swal({
......@@ -299,15 +332,15 @@
}
}}>{player.PlayerFirstname}</td
>
<td
<td class="el"
>{#if player.PlayerClub}{player.PlayerClub
.club_name}{:else}Sans Nom{/if}</td
>
<td
<td class="el"
>{#if player.PlayerRegion}{player.PlayerRegion
.region_name}{:else}Sans Nom{/if}</td
>
<td class="flag-container"
<td class="flag-container el last"
><img
src={getNationFlag(player.PlayerNation)}
alt="Player's flag : {getNationFlatAlt(
......@@ -338,7 +371,7 @@
stage?.SeedingStageID,
player
).then(() => {
loadPlayers();
loadStageAndCompetition();
});
}}
>
......@@ -368,15 +401,15 @@
border: solid 1px #003566;
}
.gold {
.gold .el {
background-color: #e9c46a;
}
.silver {
.silver .el {
background-color: #adb5bd;
}
.bronze {
.bronze .el {
background-color: #f28482;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment