mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2025-12-17 22:47:49 +01:00
tournoi better
This commit is contained in:
parent
eaf30dc043
commit
b5f43ea5f2
@ -103,9 +103,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
console.log('Displaying matches:');
|
console.log('Displaying matches:');
|
||||||
const matchListBody = document.querySelector('#match-list tbody');
|
const matchListBody = document.querySelector('#match-list tbody');
|
||||||
matchListBody.innerHTML = '';
|
matchListBody.innerHTML = '';
|
||||||
const row = document.createElement('tr');
|
|
||||||
|
|
||||||
if (matches.length != 0) {
|
if (matches.length != 0) {
|
||||||
|
const row = document.createElement('tr');
|
||||||
matches.forEach(match => {
|
matches.forEach(match => {
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td>${match.id}</td>
|
<td>${match.id}</td>
|
||||||
@ -124,6 +125,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
matchListBody.appendChild(row);
|
matchListBody.appendChild(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const row = document.createElement('tr');
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td colspan="12">No matches found.</td>
|
<td colspan="12">No matches found.</td>
|
||||||
`;
|
`;
|
||||||
@ -135,9 +137,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
console.log('Displaying players:');
|
console.log('Displaying players:');
|
||||||
const playersListBody = document.querySelector('#player-list tbody');
|
const playersListBody = document.querySelector('#player-list tbody');
|
||||||
playersListBody.innerHTML = '';
|
playersListBody.innerHTML = '';
|
||||||
const row = document.createElement('tr');
|
|
||||||
|
|
||||||
if (players.length != 0) {
|
if (players.length != 0) {
|
||||||
|
const row = document.createElement('tr');
|
||||||
players.forEach(player => {
|
players.forEach(player => {
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td>${player.id}</td>
|
<td>${player.id}</td>
|
||||||
@ -157,6 +160,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
playersListBody.appendChild(row);
|
playersListBody.appendChild(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const row = document.createElement('tr');
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td colspan="12">No matches found.</td>
|
<td colspan="12">No matches found.</td>
|
||||||
`
|
`
|
||||||
@ -168,10 +172,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
console.log('Displaying tournois:');
|
console.log('Displaying tournois:');
|
||||||
const tournoisListBody = document.querySelector('#tournoi-list tbody');
|
const tournoisListBody = document.querySelector('#tournoi-list tbody');
|
||||||
tournoisListBody.innerHTML = '';
|
tournoisListBody.innerHTML = '';
|
||||||
const row = document.createElement('tr');
|
|
||||||
|
|
||||||
if (tournois.length != 0) {
|
if (tournois.length != 0) {
|
||||||
tournois.forEach(tournoi => {
|
tournois.forEach(tournoi => {
|
||||||
|
const row = document.createElement('tr');
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td>${tournoi.id}</td>
|
<td>${tournoi.id}</td>
|
||||||
<td>${tournoi.name}</td>
|
<td>${tournoi.name}</td>
|
||||||
@ -182,6 +186,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
tournoisListBody.appendChild(row);
|
tournoisListBody.appendChild(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const row = document.createElement('tr');
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td colspan="12">No matches found.</td>
|
<td colspan="12">No matches found.</td>
|
||||||
`
|
`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user