{% comment %}
Displays links to varieties of a page, each one for a different kind of item (tweet, favorite tweet, photo, etc).

Expects:

* variety_counts -- A list of dicts, each dict with 'count', 'app_name', 'app_slug', 'variety_name' and 'variety_slug' elements.

* ditto_app_name -- eg 'twitter' or 'flickr'.

* ditto_variety_name -- eg 'tweets' or 'favorites'.

And one of:

* day -- If this is the Day Archive page, the date we're viewing.
* tag_slug -- If this is the Tag page we're viewing.

{% endcomment %}


<div class="list-group">
    {% for variety in variety_counts %}
        {% if variety.count == 0 or variety.is_active %}
            <span
        {% else %}
            <a href="{% spaceless %}
                {% if day %}
                    {% url 'ditto:day_archive' year=day|date:'Y' month=day|date:'m' day=day|date:'d' app=variety.app_slug variety=variety.variety_slug %}
                {% endif %}
           {% endspaceless %}"
        {% endif %}
           class="list-group-item d-flex justify-content-between align-items-center{% if variety.is_active %} active{% endif %}{% if variety.count == 0 and not variety.is_active %} text-muted{% endif %}">
            {% if variety.app_name == 'lastfm' %}
                Last.fm scrobbles
            {% elif variety.app_name == 'pinboard' %}
                Pinboard bookmarks
            {% elif variety.app_name == 'flickr' %}
                {% if variety.variety_name == 'photo-taken' %}
                    Flickr photos (taken)
                {% else %}
                    Flickr photos (uploaded)
                {% endif %}
            {% elif variety.app_name == 'twitter' %}
                {% if variety.variety_name == 'favorite' %}
                    Twitter likes
                {% else %}
                    Twitter tweets
                {% endif %}
            {% endif %}
            {% if variety.count > 0 %}
            <span class="badge badge-pill {% if variety.is_active %}badge-light{% else %}badge-dark{% endif %}">
                    {{ variety.count }}
                </span>
            {% endif %}
        {% if variety.count == 0 or variety.is_active %}
            </span>
        {% else %}
            </a>
        {% endif %}
    {% endfor %}
</div>

