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

Loading stage and competition in case.

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