aboutsummaryrefslogtreecommitdiff
path: root/web_interface
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2025-12-09 19:22:30 +0100
committeruser@node5.net <user@node5.net>2025-12-09 19:22:30 +0100
commita105c659388cede0ba5178c4f5e41200b5b31d55 (patch)
treed324d4fb5bc10a807aa06f61f6d74d56305c5d24 /web_interface
parent040de793feb1c49a989ebb6b1420c4294291b1b5 (diff)
Author - Full name tool tip
Diffstat (limited to 'web_interface')
-rw-r--r--web_interface/drinks/models.py4
-rw-r--r--web_interface/drinks/templates/drinks_overview.html12
2 files changed, 15 insertions, 1 deletions
diff --git a/web_interface/drinks/models.py b/web_interface/drinks/models.py
index f9933e8..88d560f 100644
--- a/web_interface/drinks/models.py
+++ b/web_interface/drinks/models.py
@@ -16,6 +16,10 @@ class Author(models.Model):
)
@property
+ def name(self) -> str:
+ return f"{self.first_name} {self.last_name}"
+
+ @property
def color(self) -> str:
value = ord(self.first_name[0].upper()) + ord(self.last_name[0].upper())
return value
diff --git a/web_interface/drinks/templates/drinks_overview.html b/web_interface/drinks/templates/drinks_overview.html
index bc83fdb..13c8e9d 100644
--- a/web_interface/drinks/templates/drinks_overview.html
+++ b/web_interface/drinks/templates/drinks_overview.html
@@ -56,7 +56,17 @@
<div class="s6">
<div class="padding">
<h4 class="drink-name">{{ drink.name }}</h4>
- {% if drink.author %}<button class="circle drink-author" style="background-color: hsl({{ drink.author.color }}deg 80% 40%);">{{ drink.author }}</button>{% endif%}
+
+ {% if drink.author %}
+ <button class="circle drink-author" style="background-color: hsl({{ drink.author.color }}deg 80% 40%);">
+ {{ drink.author }}
+ <div class="tooltip max" style="width: fit-content">
+ <b>Author</b>
+ <p>{{ drink.author.name }}</p>
+ </div>
+ </button>
+ {% endif%}
+
<p>{{ drink.description }}</p>
{% if drink.ingredient_set.all %}