Add icons to categories

This commit is contained in:
Edgar P. Burkhart 2022-05-20 22:19:13 +02:00
parent 9ca4b0d391
commit 98a1037d5e
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
4 changed files with 27 additions and 3 deletions

View file

@ -7,7 +7,7 @@
{% endblock %}
{% block body %}
<h1>{{ category }}</h1>
<h1><i class="fa fa-{{ category.icon }}"></i> {{ category }}</h1>
<form action="{% url 'update_category' category.id %}" method="post">
{% csrf_token %}

View file

@ -27,6 +27,7 @@
<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>
@ -44,7 +45,7 @@
<h2>Catégories</h2>
<div id="categories">
{% for cat in categories %}
<a href="{% url 'category' cat.id %}">{{ cat }}</a>
<a href="{% url 'category' cat.id %}"><i class="fa fa-{{ cat.icon }}"></i> {{ cat }}</a>
{% endfor %}
</div>
{% endif %}