{% extends 'atlas/base.html' %}

{% block content %}
    <h2>Collections</h2>

    The following collections are available for you to view / take. If you received a directly link to a collection it will not appear here unless you have started it.


    <h3>Available to start</h3>
    <ul>
        {% for collection in available_collections %}
            <li>
                <a href="{% url 'atlas:collection_take_start' collection.pk %}">{{ collection.name }}</a>
                {% if collection.description %}
                    <small class="text-muted">— {{ collection.description }}</small>
                {% endif %}
            </li>
        {% empty %}
            <li>No collections available to start.</li>
        {% endfor %}
    </ul>

    <h3>In progress</h3>
    <ul>
        {% for collection in in_progress_collections %}
            <li>
                <a href="{% url 'atlas:collection_take_start' collection.pk %}">{{ collection.name }}</a>
                <span class="badge bg-warning text-dark">In progress</span>
                {% if collection.description %}
                    <small class="text-muted">— {{ collection.description }}</small>
                {% endif %}
            </li>
        {% empty %}
            <li>No in-progress collections.</li>
        {% endfor %}
    </ul>

    <h3>Finished</h3>
    <ul>
        {% for collection in finished_collections %}
            <li>
                <a href="{% url 'atlas:collection_take_start' collection.pk %}">{{ collection.name }}</a>
                <span class="badge bg-success">Completed</span>
                {% if collection.description %}
                    <small class="text-muted">— {{ collection.description }}</small>
                {% endif %}
            </li>
        {% empty %}
            <li>No finished collections.</li>
        {% endfor %}
    </ul>

{% endblock %}
