mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-05-16 17:11:48 +00:00
draft: devWeb - Add informations of connected users
This commit is contained in:
@@ -10,15 +10,15 @@
|
||||
<component:card title="Menu principal">
|
||||
<ul>
|
||||
<li><a href="${pageContext.request.contextPath}/new">Nouvelle partie</a></li>
|
||||
<li><a href="${pageContext.request.contextPath}/join">Rejoindre une partie</a></li>
|
||||
<%-- <li><a href="${pageContext.request.contextPath}/join">Rejoindre une partie</a></li>--%>
|
||||
</ul>
|
||||
</component:card>
|
||||
</div>
|
||||
<div class="column">
|
||||
<component:card>
|
||||
<component:card title="Utilisateurs connectés">
|
||||
<component:connected-user-list/>
|
||||
</component:card>
|
||||
</div>
|
||||
</div>
|
||||
</component:hero>
|
||||
</layout:base>
|
||||
</layout:base>
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<table id="connected-user-list" class="table is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Utilisateur</th>
|
||||
<th>Nom d'utilisateur</th>
|
||||
<th>Nombre de parties jouées</th>
|
||||
<th>Nombre de victoires</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
@@ -26,14 +28,22 @@
|
||||
|
||||
// Add the users to the table
|
||||
users.forEach(user => {
|
||||
const tr = document.createElement('tr');
|
||||
const td = document.createElement('td');
|
||||
const tr = document.createElement('tr');
|
||||
const tdUsername = document.createElement('td');
|
||||
tdUsername.dataset.id = user.id;
|
||||
tdUsername.textContent = user.username;
|
||||
const tdNbGames = document.createElement('td');
|
||||
tdNbGames.dataset.id = user.id;
|
||||
tdNbGames.textContent = user.nbPlayedGames;
|
||||
const tdNbWin = document.createElement('td');
|
||||
tdNbWin.dataset.id = user.id;
|
||||
tdNbWin.textContent = user.nbWin;
|
||||
|
||||
td.dataset.id = user.id;
|
||||
td.textContent = user.username;
|
||||
|
||||
tr.appendChild(td);
|
||||
table.appendChild(tr);
|
||||
tr.appendChild(tdUsername);
|
||||
tr.appendChild(tdNbGames);
|
||||
tr.appendChild(tdNbWin);
|
||||
table.appendChild(tr);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user