Browse Source

no_links parameter for text_list template snippet.

master
Erik Stein 7 years ago
parent
commit
cfbd5f1b76
  1. 4
      shared/utils/templates/utils/_text_list.html

4
shared/utils/templates/utils/_text_list.html

@ -1,10 +1,10 @@
{% load i18n %} {% load i18n %}
{# List of items, where items have a (potentially empty) get_absolute_url and a name attribute #} {# 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 %} {% for item in items %}
{% if forloop.last and forloop.counter > 1 %}{% trans "und" %}{% endif %} {% if forloop.last and forloop.counter > 1 %}{% trans "und" %}{% endif %}
{% with item.get_absolute_url as url %} {% with item.get_absolute_url as url %}
{% if url %}<a href="{{ url }}">{% endif %}{{ item.name }}{% if url %}</a>{% endif %}{% if not forloop.last %}{% if forloop.revcounter0 > 1 %},{% endif %}{% endif %} {% if url and not no_links %}<a href="{{ url }}">{% endif %}{{ item.name }}{% if url and not no_links %}</a>{% endif %}{% if not forloop.last %}{% if forloop.revcounter0 > 1 %},{% endif %}{% endif %}
{% endwith %} {% endwith %}
{% endfor %} {% endfor %}

Loading…
Cancel
Save