Remove category tree

This commit is contained in:
Edgar P. Burkhart 2022-05-20 21:33:06 +02:00
parent f85c67bb49
commit 25482790dc
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
5 changed files with 89 additions and 33 deletions

View file

@ -25,7 +25,15 @@
<span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value num">{{ trans.value|floatformat:"2g" }} €</span>
<span class="trader text center">{{ trans.trader|default_if_none:"" }}</span>
<span class="category text center">{% if trans.category %}{{ trans.category.tree|join:" → " }}{% else %}{% endif %}</span>
<span class="category text center">
{% if trans.category %}
<a href="{% url 'category' trans.category.id %}">
{{ trans.category }}
</a>
{% else %}
{% endif %}
</span>
<span class="description text">{{ trans.description }}</span>
</div>
{% endfor %}
@ -33,15 +41,14 @@
{% endif %}
{% if categories %}
<ul id="categories">
<h2>Catégories</h2>
<div id="categories">
{% spaceless %}
{% for cat in categories %}
<li class="{% if cat.tree|length > 3 %}cat4{% else %}cat{{ cat.tree|length }}{% endif %}">
<a href="{% url 'category' cat.id %}">
{% if cat.tree|length > 3 %}{{ cat.tree|slice:"3:"|join:" → " }}{% else %}{{ cat.name }}{% endif %}
</a>
</li>
<a href="{% url 'category' cat.id %}">{{ cat }}</a>
{% endfor %}
</ul>
{% endspaceless %}
</div>
{% endif %}
{% endblock %}