From 038c877aed55cffdb4401a4c7e7b15b113798145 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 22 Nov 2022 22:55:36 +0100 Subject: Implemented game creation --- views/game.ejs | 6 +++--- views/games.ejs | 26 +++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'views') diff --git a/views/game.ejs b/views/game.ejs index e1fab41..7fae405 100644 --- a/views/game.ejs +++ b/views/game.ejs @@ -27,10 +27,10 @@

-player one name: 0
-player two name: 0 +<%- data.player1.username %>: <%- data.player1.score %>
+<%- data.player2.username %>: <%- data.player2.score %>

- + <%- include("footer") %> diff --git a/views/games.ejs b/views/games.ejs index 3189be8..9cee7bb 100644 --- a/views/games.ejs +++ b/views/games.ejs @@ -7,11 +7,31 @@ PartieJoueur 1Joueur 2 <% games.forEach((game) => { %> - <%= game.data.title %> - <%= game.data.player1.name %> - <%= game.data.player2.name %> + <%= game.data.name %> + <%= game.data.player1.username %> + <%= game.data.player2.username %> <% }) %> <% } %> +<% if (Object.keys(errors).length === 0) { %> +

Nouvelle partie

+<% } else { %> +

Oops, erreur lors de la création d'une nouvelle partie!

+<% } %> +
+
+ + <% if (errors.username) { %> + + <% } %> +
+
+ + <% if (errors.name) { %> + + <% } %> +
+ +
<%- include("footer") %> -- cgit v1.2.3