From 0b2d10e7b75e8682660d5424b421a06a3638b0ad Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:48:28 +0100 Subject: [PATCH] Enhanced icons and tooltips. --- static/index.js | 8 ++++++-- templates/components/bottom_controls.html | 12 ++++++------ templates/components/home_clan_bar.html | 20 ++++++++++++++------ templates/components/home_player_list.html | 15 ++++++++------- templates/components/opp_clan_bar.html | 15 +++++++++------ templates/components/opp_player_list.html | 20 +++++++++++++------- templates/index.html | 4 ++-- templates/login.html | 2 +- templates/modals/add_player.html | 1 + templates/modals/settings.html | 2 +- templates/register.html | 2 +- templates/shards/player_list_item.html | 12 ++++++------ 12 files changed, 68 insertions(+), 45 deletions(-) diff --git a/static/index.js b/static/index.js index a1009b0..f1e8fe9 100644 --- a/static/index.js +++ b/static/index.js @@ -1,9 +1,13 @@ document.addEventListener('DOMContentLoaded', function() { - const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); + initTooltips(document); +}); + +function initTooltips(elementRoot) { + const tooltipTriggerList = elementRoot.querySelectorAll('[data-bs-action="tooltip"]'); tooltipTriggerList.forEach((elem) => { new bootstrap.Tooltip(elem); }); -}); +} function setupClanButtons(dropdownId, delBtnId, editBtnId) { const dropdown = document.getElementById(dropdownId); diff --git a/templates/components/bottom_controls.html b/templates/components/bottom_controls.html index 78d3ebb..04d6f0d 100644 --- a/templates/components/bottom_controls.html +++ b/templates/components/bottom_controls.html @@ -3,12 +3,12 @@
-
-
diff --git a/templates/components/home_clan_bar.html b/templates/components/home_clan_bar.html index adf54aa..034c7e5 100644 --- a/templates/components/home_clan_bar.html +++ b/templates/components/home_clan_bar.html @@ -11,14 +11,17 @@ {{ if not (eq .UserRole "READER") }} - - - {{ end }}
@@ -28,6 +31,11 @@ diff --git a/templates/components/home_player_list.html b/templates/components/home_player_list.html index 6cee9e3..6755518 100644 --- a/templates/components/home_player_list.html +++ b/templates/components/home_player_list.html @@ -8,21 +8,22 @@
- -
{{ if not (eq .UserRole "READER") }}
- {{ end }}
-
+
0
diff --git a/templates/components/opp_clan_bar.html b/templates/components/opp_clan_bar.html index 5a58096..f4265b4 100644 --- a/templates/components/opp_clan_bar.html +++ b/templates/components/opp_clan_bar.html @@ -10,14 +10,17 @@ {{ if not (eq .UserRole "READER") }} - - - {{ end }}
diff --git a/templates/components/opp_player_list.html b/templates/components/opp_player_list.html index 97119e7..dbeebb0 100644 --- a/templates/components/opp_player_list.html +++ b/templates/components/opp_player_list.html @@ -8,21 +8,22 @@
- -
{{ if not (eq .UserRole "READER") }}
- {{ end }}
-
+
0
@@ -32,6 +33,11 @@ diff --git a/templates/index.html b/templates/index.html index 2fe9fb1..b1f06d4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,7 +8,7 @@
-

Heim-Team

+

Heim-Team

{{ template "home_clan_bar" . }} @@ -18,7 +18,7 @@
-

Gegner-Team

+

Gegner-Team

{{ template "opp_clan_bar" . }} diff --git a/templates/login.html b/templates/login.html index 2479e58..9fe3bb2 100644 --- a/templates/login.html +++ b/templates/login.html @@ -17,7 +17,7 @@
- +
diff --git a/templates/modals/add_player.html b/templates/modals/add_player.html index d883d4f..6ab8b25 100644 --- a/templates/modals/add_player.html +++ b/templates/modals/add_player.html @@ -124,6 +124,7 @@ errorDiv.innerText = ""; errorDiv.style.display = 'none'; playerName.classList.remove('is-invalid'); + initTooltips(playerList); }); } }); diff --git a/templates/modals/settings.html b/templates/modals/settings.html index 6da1ecf..9c0c763 100644 --- a/templates/modals/settings.html +++ b/templates/modals/settings.html @@ -22,7 +22,7 @@
-
+
diff --git a/templates/register.html b/templates/register.html index 71dd9e4..33efc0c 100644 --- a/templates/register.html +++ b/templates/register.html @@ -30,7 +30,7 @@
- +
diff --git a/templates/shards/player_list_item.html b/templates/shards/player_list_item.html index ea6d8a3..8f99952 100644 --- a/templates/shards/player_list_item.html +++ b/templates/shards/player_list_item.html @@ -2,24 +2,24 @@
{{ .PlayerName }} -
+
{{ .Score }}
- {{ if not (eq .UserRole "READER") }} {{ end }}