From 66c5b3e00b67e20a6d51d0ed25c50b15227ae602 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 30 Oct 2022 18:13:03 +0100 Subject: [PATCH] Add tooltips --- src/character/templates/character/view.html | 30 +++++++++++++++---- .../templatetags/character_extras.py | 5 ++++ src/common/templates/common/base.html | 4 +++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/character/templates/character/view.html b/src/character/templates/character/view.html index b78e730..724c28e 100644 --- a/src/character/templates/character/view.html +++ b/src/character/templates/character/view.html @@ -67,23 +67,43 @@ Initiative - {{ character.initiative }} + + {{ character.initiative }} + Att. contact - {{ character.attack_melee|modifier }} + + {{ character.attack_melee|modifier }} + Att. distance - {{ character.attack_range|modifier }} + + {{ character.attack_range|modifier }} + Att. magique - {{ character.attack_magic|modifier }} + + {{ character.attack_magic|modifier }} + Défense - {{ character.defense }} + + {{ character.defense }} + diff --git a/src/character/templatetags/character_extras.py b/src/character/templatetags/character_extras.py index 4af1ded..ccca227 100644 --- a/src/character/templatetags/character_extras.py +++ b/src/character/templatetags/character_extras.py @@ -9,3 +9,8 @@ def modifier(value): return f"+{value}" else: return value + + +@register.filter +def sub(value, arg): + return value - arg diff --git a/src/common/templates/common/base.html b/src/common/templates/common/base.html index 43c5f92..340b3ef 100644 --- a/src/common/templates/common/base.html +++ b/src/common/templates/common/base.html @@ -40,5 +40,9 @@ +