{% load i18n %}

{% if thesaurus %}
        <p class="term-filter{% if not alpha_sort %} active{% endif %}">
            <a href="{% url 'front_termlist' %}?thesaurus={{thesaurus}}">{% trans "Termes les plus fréquents" %}</a>
        </p>
    {% if show_alphabet %}
        <ul class="term-filter letter-list">
        {% for letter in alphabet %}
            <li class="letter{% if letter == current_letter %} active{% endif %}"><a href="{% url 'front_termlist' %}?thesaurus={{thesaurus}}&letter={{letter|urlencode}}">{{letter}}</a></li>
        {% endfor %}
        </ul>
    {% else %}
        <p class="term-filter{% if alpha_sort %} active{% endif %}">
            <a href="{% url 'front_termlist' %}?thesaurus={{thesaurus}}&alphabet=1">{% trans "Classer par ordre alphabétique" %}</a>
        </p>
    {% endif %}
        <ul class="terms clearfix">
        {% for term in terms %}
            <li class="term" data-dbpedia-uri="{{term.dbpedia_uri}}">
                <div class="term-image-wrap">
                    <img class="term-image" src="{{JOCONDE_IMAGE_BASE_URL}}{{term.image_url}}" />
                </div>
                <h3 data-dbpedia-uri="{{term.dbpedia_uri}}"><a href="{% url 'front_search' %}?dbpedia_uri={{term.dbpedia_uri|urlencode}}">{{term.label}}</a></h3>
                    {% if term.abstract %}<p>{{term.abstract|truncatechars:100}}</p>{% endif %}
            </li>
        {% endfor %}
        </ul>
{% else %}
        <ul class="term-cloud">
            {% for word in words %}
                <li style="font-size: {{word.font_size}}em">
                    <a href="{% url 'front_search' %}?dbpedia_uri={{word.uri|urlencode}}" data-dbpedia-uri="{{word.uri}}">{{word.label}}</a>
                </li>
            {% endfor %}
        </ul>
{% endif %}