Add money + display notes

This commit is contained in:
Gabriel Augendre 2022-10-30 16:51:17 +01:00
parent c91dedde93
commit 6f392a4603
4 changed files with 50 additions and 2 deletions

View file

@ -0,0 +1,33 @@
# Generated by Django 4.1.2 on 2022-10-30 15:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("character", "0012_alter_capability_options_alter_character_options_and_more"),
]
operations = [
migrations.AddField(
model_name="character",
name="money_pa",
field=models.PositiveSmallIntegerField(default=0, verbose_name="PA"),
),
migrations.AddField(
model_name="character",
name="money_pc",
field=models.PositiveSmallIntegerField(default=0, verbose_name="PC"),
),
migrations.AddField(
model_name="character",
name="money_po",
field=models.PositiveSmallIntegerField(default=0, verbose_name="PO"),
),
migrations.AddField(
model_name="character",
name="money_pp",
field=models.PositiveSmallIntegerField(default=0, verbose_name="PP"),
),
]

View file

@ -1 +1 @@
0012_alter_capability_options_alter_character_options_and_more
0013_character_money_pa_character_money_pc_and_more

View file

@ -133,6 +133,11 @@ class Character(models.Model):
default=0, verbose_name="mana utilisé"
)
money_pp = models.PositiveSmallIntegerField(default=0, verbose_name="PP")
money_po = models.PositiveSmallIntegerField(default=0, verbose_name="PO")
money_pa = models.PositiveSmallIntegerField(default=0, verbose_name="PA")
money_pc = models.PositiveSmallIntegerField(default=0, verbose_name="PC")
notes = models.TextField(blank=True, verbose_name="notes")
objects = CharacterManager()

View file

@ -156,10 +156,16 @@
<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>
</div>
<h5 class="mt-3">Voies & Capacités</h5>
</div>
<h4 class="mt-3">Voies & Capacités</h4>
<div class="row gy-3">
{% for path, capabilities in character.get_capabilities_by_path.items %}
<div class="col-xl-3 col-md-6">
@ -185,4 +191,8 @@
</div>
{% endfor %}
</div>
<h4 class="mt-3">Notes</h4>
<div class="row">
{{ character.notes|linebreaks }}
</div>
{% endblock %}