{% load i18n %}
{% if tasks %}
  <table>
    <thead>
      <tr>
        <th>{% translate "python path"|title context "noun" %}</th>
        <th>{% translate "queue"|title context "noun" %}</th>
        <th>{% translate "backend"|title %}</th>
        <th>{% translate "priority"|title %}</th>
        <th>{% translate "run after"|title %}</th>
        <th>{% translate "status"|title %}</th>
        <th>{% translate "arguments"|title %}</th>
        <th>{% translate "keyword arguments"|title %}</th>
      </tr>
    </thead>
    <tbody>
      {% for task in tasks %}
        <tr>
          <td>{{ task.task.module_path|escape }}</td>
          <td>{{ task.task.queue_name|escape }}</td>
          <td>{{ task.backend|escape }}</td>
          <td>{{ task.task.priority }}</td>
          <td>{{ task.task.run_after|default:"—" }}</td>
          <td>{{ task.status }}</td>
          <td><code>{{ task.args|pprint }}</code></td>
          <td>
            <code>{% if task.kwargs %}{{ task.kwargs|pprint }}{% else %}—{% endif %}</code>
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% elif tasks_available %}
  <p>{% translate "No tasks were queued during this request." %}</p>
{% else %}
  <p>
    {% blocktranslate %}
      The Tasks panel requires Django 6.0 or later. Upgrade Django to see
      information about tasks queued during this request.
    {% endblocktranslate %}
  </p>
{% endif %}
