{% extends "ox_layout.html" %}
{% block body %}

<div class="w3-light-grey w3-margin-bottom">
  <h2>Available Tasks</h2>
  <TABLE cellpadding="10">
    <TH>Name</TH>
    <TH>ID</TH>
    <TH>Status</TH>
    <TH>Result</TH>
    <TH>Finished at</TH>
    {% for item in tasks|sort(reverse=True, attribute='task_end_utc') %}
    <TR>
      <TD>{{ item.task_name }}</TD>
      <TD>
	<A HREF="{{ url_for('ox_herd.show_task') + '?task_id='+item.task_id}}">
	  {{  item.task_id  }}
	</A>
      </TD>
      <TD>{{ item.task_status }}</TD>
      <TD>{{ item.return_value }}</TD>
      <TD>{{ item.task_end_utc }}</TD>
      <TD>
	<A HREF="{{ url_for('ox_herd.delete_task_from_db') 
		 + '?task_id='+item.task_id}}">delete</A>
      </TD>
    </TR>
    {% endfor %}
  </TABLE>
</div>

{% endblock %}
