{% load i18n %}
{% load my_filters %}

<div class="userstatus">
    <table class="table table-bordered">
        <thead>
            <tr>
                {% for exercise in exercises %}
                    <th class="headrow data">
                        <div><a href="{% url 'learn' %}{{ exercise.path }}" title='"{% trans exercise.display_name %}"{% if exercise.description %} ({% trans exercise.description %}){% endif %}'>{% trans exercise.title %}</a></div>
                    </th>
                {% endfor %}
            </tr>
        </thead>
        <tbody>
            {% for student in students %}
                <tr>
                    {% for exercise in exercises %}
                        {% if not student.exercise_logs|get_item:exercise.slug %}
                            <td class="status data" title="{% trans "Not Attempted" %}">
                        {% elif student.exercise_logs|get_item:exercise.slug|get_item:"struggling" %}
                            <td class="status data struggle" title="{% trans "Struggling" %}">
                        {% elif student.exercise_logs|get_item:exercise.slug|get_item:"complete" %}
                            <td class="status data complete" title="{% trans "Complete" %}">
                        {% else %}
                            <td class="status data partial" title="{% trans "Attempted" %}">
                        {% endif %}
                            </td>
                    {% endfor %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div>