From e0e9e5b513b45f0b1358f7f945c5803c0cdbda28 Mon Sep 17 00:00:00 2001 From: Erik Stein Date: Mon, 31 Jul 2017 16:24:52 +0200 Subject: [PATCH] text_list HTML template. --- utils/templates/utils/_text_list.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 utils/templates/utils/_text_list.html diff --git a/utils/templates/utils/_text_list.html b/utils/templates/utils/_text_list.html new file mode 100644 index 0000000..7f09137 --- /dev/null +++ b/utils/templates/utils/_text_list.html @@ -0,0 +1,9 @@ +{% load i18n %} +{# List of items, where items have a (potentially empty) get_absolute_url and a name attribute #} + + {% for item in items %} + {% if forloop.last and forloop.counter > 1 %}{% trans "und" %}{% endif %} + {% with item.get_absolute_url as url %} + {% if url %}{% endif %}{{ item.name }}{% if url %}{% endif %}{% if not forloop.last %}{% if forloop.revcounter0 > 1 %},{% endif %}{% endif %} + {% endwith %} + {% endfor %}