diff --git a/src/character/templates/character/snippets/character_details/states.html b/src/character/templates/character/snippets/character_details/states.html index 6137566..1f87e42 100644 --- a/src/character/templates/character/snippets/character_details/states.html +++ b/src/character/templates/character/snippets/character_details/states.html @@ -1,3 +1,4 @@ +{% load character_extras %}
États : {% with character.states.all as character_states %} @@ -8,12 +9,16 @@ data-bs-title="{{ state.name }} : {{ state.description }}" {% if state in character_states %} class="state-enabled" - hx-get="{% url "character:remove_state" pk=character.pk state_pk=state.pk %}" - {% else %} - hx-get="{% url "character:add_state" pk=character.pk state_pk=state.pk %}" {% endif %} - hx-target="#states" - hx-swap="outerHTML" + {% if character|managed_by:user %} + {% if state in character_states %} + hx-get="{% url "character:remove_state" pk=character.pk state_pk=state.pk %}" + {% else %} + hx-get="{% url "character:add_state" pk=character.pk state_pk=state.pk %}" + {% endif %} + hx-target="#states" + hx-swap="outerHTML" + {% endif %} > {% endfor %} {% endwith %}