{% load filters %}

<table class="table table-flush" style="margin-top: 30px; table-layout: fixed; width: 100%;">
    <thead class="thead-light">
        <th></th>
        {% for task in set.settasks_ordered %}
            <th style="text-align: center;">{{ task.name }}</th>
        {% endfor %}
    </thead>
    <tbody>
        {% for user in users %}
            <tr>
                <td>{{ user.userinfo }}</td>
                {% for task in set.settasks_ordered %}
                    <td style="text-align: center;">
                        {% with pair=user.id|make_pair:task.id %}
                            {% with result=data|get_info:pair %}
                                {% if result == in_queue_status %}
                                     <span class="badge bg-secondary">{{ result }}</span>
                                {% else %}{% if result == ok_status %}
                                     <span class="badge bg-success">{{ result }}</span>
                                {% else %}{% if result|startswith:testing_status %}
                                    <span class="badge bg-info">{{ result }}</span>
                                {% else %}{% if result %}
                                    <span class="badge bg-danger">{{ result }}</span>
                                {% else %}
                                    <span class="badge bg-warning">-</span>
                                {% endif %}{% endif %}{% endif %}{% endif %}
                            {% endwith %}
                        {% endwith %}
                    </td>
                {% endfor %}
            </tr>
        {% endfor %}
    </tbody>
</table>