mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-22 22:48:03 +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">
|
<p id="states">
|
||||||
États :
|
États :
|
||||||
{% with character.states.all as character_states %}
|
{% with character.states.all as character_states %}
|
||||||
|
@ -8,12 +9,16 @@
|
||||||
data-bs-title="{{ state.name }} : {{ state.description }}"
|
data-bs-title="{{ state.name }} : {{ state.description }}"
|
||||||
{% if state in character_states %}
|
{% if state in character_states %}
|
||||||
class="state-enabled"
|
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 %}"
|
hx-get="{% url "character:remove_state" pk=character.pk state_pk=state.pk %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
hx-get="{% url "character:add_state" pk=character.pk state_pk=state.pk %}"
|
hx-get="{% url "character:add_state" pk=character.pk state_pk=state.pk %}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
hx-target="#states"
|
hx-target="#states"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
|
{% endif %}
|
||||||
>
|
>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
Loading…
Reference in a new issue