mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-05 06:13:55 +01:00
Fix states click on other characters
This commit is contained in:
parent
67fcfa633d
commit
b929cb6cbd
1 changed files with 10 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
|||
{% load character_extras %}
|
||||
<p id="states">
|
||||
É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"
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
|
|
Loading…
Reference in a new issue