diff --git a/src/character/models/character.py b/src/character/models/character.py index 3db3de2..8113318 100644 --- a/src/character/models/character.py +++ b/src/character/models/character.py @@ -179,3 +179,11 @@ class Character(models.Model): @property def mana_remaining(self) -> int: return self.mana_max - self.mana_consumed + + @property + def height_m(self) -> float: + return round(self.height / 100, 2) + + @property + def imc(self) -> float: + return self.weight / (self.height_m**2) diff --git a/src/character/templates/character/view.html b/src/character/templates/character/view.html index 2ac1a50..5289428 100644 --- a/src/character/templates/character/view.html +++ b/src/character/templates/character/view.html @@ -4,5 +4,14 @@ {% block content %}
+ Edit +
++ Joueur : {{ character.player.get_full_name|default:character.player.username }} +
+
+ {{ character.race.name }} {{ character.profile.name }} niv. {{ character.level }}
+ {{ character.get_gender_display }}, {{ character.age }} ans, {{ character.height_m }}m, {{ character.weight }}kg (IMC: {{ character.imc }})
+