From 274f14e56e7dc16a8f420d7541bef3720fc6c7d3 Mon Sep 17 00:00:00 2001 From: Neffi42 <114996380+Neffi42@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:27:39 +0200 Subject: [PATCH] update displayToast --- django/src/ft_auth/templates/authentification.html | 4 ++-- django/src/ft_auth/templates/settings.html | 4 ++-- django/src/games/templates/pong_tournament.html | 4 ++-- nginx/src/index.html | 4 ++-- nginx/src/js/core.js | 5 ++++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/django/src/ft_auth/templates/authentification.html b/django/src/ft_auth/templates/authentification.html index c358a97..3d5e2f5 100644 --- a/django/src/ft_auth/templates/authentification.html +++ b/django/src/ft_auth/templates/authentification.html @@ -128,7 +128,7 @@

Johnny Depp

submitForm('register-form', () => { route('/login'); - displayToast("Account creation successful."); + displayToast("Account creation successful.", "bg-success"); }, (json) => { document.getElementById('register-error').textContent = json.error; emptyPasswords(); @@ -293,4 +293,4 @@

Johnny Depp

overflow-wrap: break-word; } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/django/src/ft_auth/templates/settings.html b/django/src/ft_auth/templates/settings.html index 591353c..f3ab6c1 100644 --- a/django/src/ft_auth/templates/settings.html +++ b/django/src/ft_auth/templates/settings.html @@ -100,7 +100,7 @@

Upload New Avatar

submitForm('password-form', () => { route('/settings'); - displayToast("Password changed successfully."); + displayToast("Password changed successfully.", "bg-success"); }, (json) => { document.getElementById('password-error').textContent = json.error; emptyPasswords(); @@ -144,7 +144,7 @@

Upload New Avatar

const avatarImg = document.querySelector('.profile-image-container img'); avatarImg.src = data.avatar_url; hideModal(); - displayToast("Avatar updated successfully."); + displayToast("Avatar updated successfully.", "bg-success"); } else { alert('Error uploading avatar'); } diff --git a/django/src/games/templates/pong_tournament.html b/django/src/games/templates/pong_tournament.html index 9e03e23..04af1fb 100644 --- a/django/src/games/templates/pong_tournament.html +++ b/django/src/games/templates/pong_tournament.html @@ -95,7 +95,7 @@

{% trans "Match history" %}

case "join": handleJoin(data.players); break; case "player_pairs": handlePlayerPairs(data.player_pairs); break; case "next_round_id": route(`/pong/online/${data.id}/{{ name }}/${power}`); break; - case "bye": displayToast("You have received a bye for this round. Enjoy the break!"); break; + case "bye": displayToast("You have received a bye for this round. Enjoy the break!", "bg-info"); break; case "history": handleHistory(data.history); break; case "end": handleEnd(data.winner); break; default: console.error("Invalid message from server ignored."); break; @@ -182,7 +182,7 @@

{% trans "Match history" %}

const tableBody = document.querySelector("#players tbody"); const rowCount = tableBody.rows.length; if (rowCount < 2) { - displayToast("You are alone in the tournament..."); + displayToast("You are alone in the tournament...", "bg-warning"); return; } hideBtn(lockBtn); diff --git a/nginx/src/index.html b/nginx/src/index.html index 82857cc..baa4649 100644 --- a/nginx/src/index.html +++ b/nginx/src/index.html @@ -26,7 +26,7 @@
-