diff options
Diffstat (limited to 'web_interface')
| -rw-r--r-- | web_interface/drinks/models.py | 4 | ||||
| -rw-r--r-- | web_interface/drinks/templates/drinks_overview.html | 12 |
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 %} |
