charasheet/src/character/templates/character/snippets/character_details/paths_and_capabilities.html

31 lines
1.4 KiB
HTML
Raw Normal View History

2022-11-06 15:06:29 +01:00
{% load character_extras %}
2022-11-01 11:20:44 +01:00
{% load django_bootstrap5 %}
2022-10-31 23:23:28 +01:00
<div id="paths-and-capabilities">
2022-11-10 22:44:53 +01:00
<h2>Voies & Capacités <span class="badge text-bg-{% if character.capability_points_remaining > 0 %}success{% elif character.capability_points_remaining == 0 %}secondary{% else %}danger{% endif %} rounded-pill">{{ character.capability_points_remaining }}</span></h2>
2022-11-06 15:06:29 +01:00
{% if character|managed_by:user %}
<form>
{% csrf_token %}
<div class="row">
<div class="col">
{% bootstrap_form_errors add_path_form %}
<div class="input-group">
{{ add_path_form.character_path }}
{{ add_path_form.other_path }}
<button class="btn btn-primary"
hx-target="#paths-and-capabilities"
hx-swap="outerHTML"
hx-post="{% url "character:add_path" pk=character.pk %}">
2022-11-06 15:06:29 +01:00
Sélectionner
</button>
</div>
2022-10-31 23:23:28 +01:00
</div>
</div>
2022-11-06 15:06:29 +01:00
</form>
{% endif %}
2022-10-31 23:23:28 +01:00
<div class="row mt-2 gy-3">
2022-11-09 20:49:57 +01:00
{% for path, character_capabilities in character.get_capabilities_by_path.items %}
2022-11-02 22:52:36 +01:00
{% include "character/snippets/character_details/path.html" %}
2022-10-31 23:23:28 +01:00
{% endfor %}
</div>
</div>