{% if workspace %}
    <p>
        Workspace: {{ workspace }}
    </p>
{% endif %}

{% if work_request_list %}
    <table class="table table-sm">
        <thead>
        <tr>
            <th>
                Id {% include "web/_order.html" with name="id" order=order asc=asc only %}
            </th>
            <th>
                Created at {% include "web/_order.html" with name="created_at" order=order asc=asc only %}
            </th>
            <th>
                Task name {% include "web/_order.html" with name="task_name" order=order asc=asc only %}
            </th>
            <th>
                Status {% include "web/_order.html" with name="status" order=order asc=asc only %}
            </th>
            <th>
                Result {% include "web/_order.html" with name="result" order=order asc=asc only %}
            </th>
        </tr>
        </thead>
        <tbody>
        {% for work_request in work_request_list %}
            <tr>
                <td>
                    <a href="{% url "work_requests:detail" pk=work_request.id %}">{{ work_request.id }}</a>
                </td>
                <td>{{ work_request.created_at }}</td>
                <td>{{ work_request.task_name }}</td>
                <td>{% include "web/_work_request-status.html" with status=work_request.status only %}</td>
                <td>{% include "web/_work_request-result.html" with result=work_request.result only %}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <p>
        No work requests.
    </p>
{% endif %}

{% if not user.is_authenticated %}
    Not authenticated. Only work requests in public workspaces are listed.
{% endif %}
