Rendering tag lists with templates

This commit is contained in:
Paul Konstantin Gerke 2022-03-08 14:52:18 +01:00 committed by Christopher Charbonneau Wells
parent 3fa652cc25
commit 4919222d41
3 changed files with 9 additions and 7 deletions

View File

@ -56,13 +56,7 @@
{% endif %}
<td>{{ note.note }}</td>
<td>
{% for tag in note.tags.all %}
<span class="badge badge-pill" style="background-color:{{ tag.color }};color:{{ tag.complementary_color }};">
{{ tag.name|escape }}
</span>
{% empty %}
-
{% endfor %}
{% include "core/render_tag_list.html" with tags=note.tags.all %}
</td>
</tr>
{% empty %}

View File

@ -0,0 +1,3 @@
<span class="badge badge-pill" style="background-color:{{ tag.color }};color:{{ tag.complementary_color }};">
{{ tag.name|escape }}
</span>

View File

@ -0,0 +1,5 @@
{% for tag in tags %}
{% include "core/render_tag.html" %}
{% empty %}
-
{% endfor %}