summaryrefslogtreecommitdiff
path: root/public/join.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-28 12:38:42 +0200
committerTor Andersson <tor@ccxvii.net>2021-06-28 22:10:44 +0200
commit401a13ff9e7792f0e060ccfb15afdbd3bc5fc557 (patch)
treeb96febaeaa3cc78bb5872be58c10bccc7a04d622 /public/join.js
parentdd165d03e95f252150a94fc27d0280551d7e041b (diff)
downloadserver-401a13ff9e7792f0e060ccfb15afdbd3bc5fc557.tar.gz
Clean up SQL and use table views.
Diffstat (limited to 'public/join.js')
-rw-r--r--public/join.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/public/join.js b/public/join.js
index d2d39ab..5353f11 100644
--- a/public/join.js
+++ b/public/join.js
@@ -84,24 +84,23 @@ function update() {
let element = document.getElementById(role_id);
if (player) {
if (game.status > 0) {
- if (game.active === role || game.active === "Both" || game.active === "All")
- element.className = "your_turn";
+ if (game.active_role === role || game.active_role === "Both" || game.active_role === "All")
+ element.className = "is_your_turn";
else
element.className = "";
if (player.user_id === user_id)
element.innerHTML = `<a href="/play/${game.game_id}/${role}">Play</a>`;
else
- element.innerHTML = player.name;
+ element.innerHTML = player.user_name;
} else {
if ((player.user_id === user_id) || (game.owner_id === user_id))
- element.innerHTML = `<a class="red" href="javascript:send('/part/${game.game_id}/${role}')">\u274c</a> ${player.name}`;
+ element.innerHTML = `<a class="red" href="javascript:send('/part/${game.game_id}/${role}')">\u274c</a> ${player.user_name}`;
else
- element.innerHTML = player.name;
+ element.innerHTML = player.user_name;
}
} else {
if (game.status === 0)
- //element.innerHTML = `<a class="join" href="javascript:send('/join/${game.game_id}/${role}')">Join</a>`;
- element.innerHTML = `<a class="join" onclick="send('/join/${game.game_id}/${role}')" href="javascript:void 0">Join</a>`;
+ element.innerHTML = `<a class="join" href="javascript:send('/join/${game.game_id}/${role}')">Join</a>`;
else
element.innerHTML = "<i>Empty</i>";
}
@@ -122,7 +121,7 @@ function update() {
if (game.owner_id === user_id) {
window.start_button.disabled = !ready;
window.start_button.classList = (game.status === 0) ? "" : "hide";
- window.delete_button.classList = (game.status === 0 || solo) ? "" : "hide";
+ window.delete_button.classList = (game.status === 0 || game.is_solo) ? "" : "hide";
}
if (game.status === 0 && ready)