From cfbd5f1b76bc822c7daaf352f8651bff3fb35445 Mon Sep 17 00:00:00 2001 From: Erik Stein Date: Tue, 6 Feb 2018 12:21:27 +0100 Subject: [PATCH] no_links parameter for text_list template snippet. --- shared/utils/templates/utils/_text_list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/utils/templates/utils/_text_list.html b/shared/utils/templates/utils/_text_list.html index 4c8ac38..0d6a321 100644 --- a/shared/utils/templates/utils/_text_list.html +++ b/shared/utils/templates/utils/_text_list.html @@ -1,10 +1,10 @@ {% load i18n %} {# List of items, where items have a (potentially empty) get_absolute_url and a name attribute #} -{# Usage: {% include "utils/_text_list.html" with items=page.get_authors %} #} +{# Usage: {% include "utils/_text_list.html" with items=page.get_authors no_links=True %} #} {% 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 %} + {% if url and not no_links %}{% endif %}{{ item.name }}{% if url and not no_links %}{% endif %}{% if not forloop.last %}{% if forloop.revcounter0 > 1 %},{% endif %}{% endif %} {% endwith %} {% endfor %}