diff --git a/src/character/models/character.py b/src/character/models/character.py index b45133e..bbf4110 100644 --- a/src/character/models/character.py +++ b/src/character/models/character.py @@ -337,3 +337,6 @@ class Character(models.Model): return HarmfulState.objects.exclude( pk__in=self.states.all().values_list("pk", flat=True) ) + + def managed_by(self, user): + return self in Character.objects.managed_by(user) diff --git a/src/character/templates/character/character_details.html b/src/character/templates/character/character_details.html index 681e209..32b2428 100644 --- a/src/character/templates/character/character_details.html +++ b/src/character/templates/character/character_details.html @@ -7,9 +7,11 @@ {% block content %}
- Edit -
+ {% if character|managed_by:user %} ++ Edit +
+ {% endif %}Joueur : {{ character.player.get_full_name|default:character.player.username }}
@@ -28,30 +30,32 @@diff --git a/src/character/templates/character/snippets/character_details/equipment_display.html b/src/character/templates/character/snippets/character_details/equipment_display.html index fa4b71a..242d76e 100644 --- a/src/character/templates/character/snippets/character_details/equipment_display.html +++ b/src/character/templates/character/snippets/character_details/equipment_display.html @@ -1,13 +1,16 @@ +{% load character_extras %}
diff --git a/src/character/templates/character/snippets/character_details/notes_display.html b/src/character/templates/character/snippets/character_details/notes_display.html index 725018a..2135d7b 100644 --- a/src/character/templates/character/snippets/character_details/notes_display.html +++ b/src/character/templates/character/snippets/character_details/notes_display.html @@ -1,13 +1,16 @@ +{% load character_extras %}