Align equipment update with damage reduction

This commit is contained in:
Gabriel Augendre 2022-10-30 23:46:51 +01:00
parent 3a949fe2d7
commit 1479a4fe53
3 changed files with 47 additions and 36 deletions

View file

@ -1,12 +1,23 @@
<p class="card-text"> <div class="card" id="equipment">
<a hx-get="{% url "character:equipment_change" pk=character.pk %}" <h5 class="card-header">
hx-target="#equipment" Équipement
hx-swap="innerHTML" <a hx-get="{% url "character:equipment_change" pk=character.pk %}"
class="btn btn-primary btn-sm" hx-target="#equipment"
> hx-swap="outerHTML"
<i class="fa-solid fa-pen-to-square"></i> Edit class="btn btn-primary btn-sm"
</a> >
</p> <i class="fa-solid fa-pen-to-square"></i> Edit
<p class="card-text"> </a>
{{ character.equipment|linebreaksbr|default:"Rien ici..." }} </h5>
</p> <div class="card-body">
<p class="card-text">
{{ character.equipment|linebreaksbr|default:"Rien ici..." }}
</p>
</div>
<div class="card-footer">
{{ character.money_pp }} pp,
{{ character.money_po }} po,
{{ character.money_pa }} pa,
{{ character.money_pc }} pc
</div>
</div>

View file

@ -1,13 +1,24 @@
<form> <form id="equipment">
<p> <div class="card">
<a hx-post="{% url "character:equipment_change" pk=character.pk %}" <h5 class="card-header">
hx-target="#equipment" Équipement
hx-swap="innerHTML" <a hx-post="{% url "character:equipment_change" pk=character.pk %}"
class="btn btn-primary btn-sm" hx-target="#equipment"
> hx-swap="innerHTML"
<i class="fa-solid fa-save"></i> Save class="btn btn-primary btn-sm"
</a> >
</p> <i class="fa-solid fa-save"></i> Save
{% csrf_token %} </a>
<textarea class="form-control" name="equipment" rows="10">{{ character.equipment }}</textarea> </h5>
<div class="card-body">
{% csrf_token %}
<textarea class="form-control" name="equipment" rows="10">{{ character.equipment }}</textarea>
</div>
<div class="card-footer">
{{ character.money_pp }} pp,
{{ character.money_po }} po,
{{ character.money_pa }} pa,
{{ character.money_pc }} pc
</div>
</div>
</form> </form>

View file

@ -329,18 +329,7 @@
{% include "character/damage_reduction_display.html" %} {% include "character/damage_reduction_display.html" %}
</div> </div>
<div class="col-md-12 col-lg-4 mb-3"> <div class="col-md-12 col-lg-4 mb-3">
<div class="card"> {% include "character/equipment_display.html" %}
<h5 class="card-header">Équipement</h5>
<div class="card-body" id="equipment">
{% include "character/equipment_display.html" %}
</div>
<div class="card-footer">
{{ character.money_pp }} pp,
{{ character.money_po }} po,
{{ character.money_pa }} pa,
{{ character.money_pc }} pc
</div>
</div>
</div> </div>
</div> </div>
<h4>Voies & Capacités</h4> <h4>Voies & Capacités</h4>