diff options
author | Julien Dessaux | 2022-11-21 21:39:17 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-11-21 21:39:17 +0100 |
commit | 8ac636186cf5f704264e7473864c54b3edaf4049 (patch) | |
tree | 6f575d5b4dc5afc0c087e0467c4dd7d6e4a6dd6b /views/games.ejs | |
parent | cleaned up the distinction between routes and controllers (diff) | |
download | jeux-de-mots-8ac636186cf5f704264e7473864c54b3edaf4049.tar.gz jeux-de-mots-8ac636186cf5f704264e7473864c54b3edaf4049.tar.bz2 jeux-de-mots-8ac636186cf5f704264e7473864c54b3edaf4049.zip |
Added basic games handling
Diffstat (limited to '')
-rw-r--r-- | views/games.ejs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/views/games.ejs b/views/games.ejs new file mode 100644 index 0000000..3189be8 --- /dev/null +++ b/views/games.ejs @@ -0,0 +1,17 @@ +<%- include("header") %> +<% if (Object.keys(games).length === 0) { %> +<h2>Aucune partie en cours</h2> +<% } else { %> +<h2>Liste des parties en cours</h2> +<table id="games"> + <tr><th>Partie</th><th>Joueur 1</th><th>Joueur 2</th></tr> + <% games.forEach((game) => { %> + <tr> + <td><a href="/games/<%= game.id %>"><%= game.data.title %></a></td> + <td><a href="/users/<%= game.player1 %>"><%= game.data.player1.name %></a></td> + <td><a href="/users/<%= game.player2 %>"><%= game.data.player2.name %></a></td> + </tr> + <% }) %> +</table> +<% } %> +<%- include("footer") %> |