Updat transaction list in category with table

This commit is contained in:
Edgar P. Burkhart 2022-05-22 10:35:22 +02:00
parent f3d0d3d746
commit 57ace376d8
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -1,9 +1,11 @@
{% extends "main/base.html" %} {% extends "main/base.html" %}
{% load static %} {% load static %}
{% load main_extras %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" /> <link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" />
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" />
{% endblock %} {% endblock %}
{% block body %} {% block body %}
@ -23,15 +25,36 @@
</form> </form>
{% if transactions %} {% if transactions %}
<h2>Transactions ({{ transactions|length }})</h2> <h2>Transactions</h2>
<ul>
{% for transaction in transactions %} <div id="transactions" class="table col6">
<li> <div class="header">
<a href="{% url 'transaction' transaction.id %}"> <strong class="date center">Date</strong>
{{ transaction }} <strong class="name">Nom</strong>
</a> <strong class="value center">Valeur</strong>
</li> <strong class="trader center">Commerçant</strong>
{% endfor %} <strong class="category center">Catégorie</strong>
</ul> <strong class="description">Description</strong>
</div>
{% for trans in transactions %}
<div class="transaction {% cycle 'w' 'g' %}">
<span class="date num center">{{ trans.date|date:"Y-m-d" }}</span>
<span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value num right">{{ trans.value|floatformat:"2g"|pm }} €</span>
<span class="trader text center">{{ trans.trader|default_if_none:"" }}</span>
<span class="category text center">
{% if trans.category %}
<i class="fa fa-{{ trans.category.icon }}"></i>
<a href="{% url 'category' trans.category.id %}">
{{ trans.category }}
</a>
{% else %}
{% endif %}
</span>
<span class="description text">{{ trans.description }}</span>
</div>
{% endfor %}
</div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}