diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-16 16:59:19 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-05-16 17:02:44 +0200 |
commit | 304f528f813beec76acf621ba6df5e3e0cb59eba (patch) | |
tree | 0004cd3ed17482d9e4020c4874281de6c1a59382 /views | |
parent | 0247427e0351080e96cc97ab75a8bc614b6b20bd (diff) | |
download | server-304f528f813beec76acf621ba6df5e3e0cb59eba.tar.gz |
server: Random role selection.
Diffstat (limited to 'views')
-rw-r--r-- | views/create.ejs | 5 | ||||
-rw-r--r-- | views/join.ejs | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/views/create.ejs b/views/create.ejs index ed9ae9e..5db8fe6 100644 --- a/views/create.ejs +++ b/views/create.ejs @@ -15,6 +15,11 @@ Description:<br> <input type="text" autocomplete="off" id="description" name="description" size="50"> <p> <label> +<input type="checkbox" id="random" name="random" value="random"> +<span>Random player roles</span> +</label> +<p> +<label> <input type="checkbox" id="private" name="private" value="private"> <span>Private</span> </label> diff --git a/views/join.ejs b/views/join.ejs index 810e0f4..42feaaf 100644 --- a/views/join.ejs +++ b/views/join.ejs @@ -11,9 +11,11 @@ function confirm_delete(status) { <p> Owner: <%= game.owner_name %> -<p> +<br> +Private: <%= game.private ? "yes" : "no" %> +<br> Scenario: <%= game.scenario %> -<p> +<br> Description: <%= game.description || "No description." %> <br clear=left> @@ -23,18 +25,18 @@ Description: <%= game.description || "No description." %> <tr> <% roles.forEach((role) => { - %><th><%= role.role %><% + %><th><%= role %><% }); %> <tr> <% roles.forEach((role) => { - if (game.active == role.role || game.active == "Both" || game.active == "All") { + if (game.active == role || game.active == "Both" || game.active == "All") { %><td style="min-width:9em" class="your_turn"><% } else { %><td style="min-width:9em"><% } - let p = players.find(p => p.role == role.role); + let p = players.find(p => p.role == role); if (game.status == 0) { if (p) { if ((p.user_id == user.user_id) || (game.owner_id == user.user_id)) { @@ -44,7 +46,7 @@ Description: <%= game.description || "No description." %> %><%= p.name %><% } } else { - %><a href="/join/<%= game.game_id %>/<%= role.role %>">Join</a><% + %><a href="/join/<%= game.game_id %>/<%= role %>">Join</a><% } } else { if (p) { |