{% extends 'admin/model/list.html' %}
{% block body %}
  {% if data %}
    {% set task = data[0].task %}
    <h1>{{task.filename}}</h1>
    <table class="table table-hover table-bordered searchable">
      <tbody>
        <tr>
          <td>
            <b>Task Filename</b>
          </td>
          <td>
            {{task.filename}}
          </td>
        </tr>
        <tr>
          <td>
            <b>Organisation</b>
          </td>
          <td>
            {{task.org.name}}
          </td>
        </tr>
        <tr>
          <td>
            <b>Completed At</b>
          </td>
          <td>
            {% if task.completed_at %}
              {{task.completed_at|isodate}}
            {% else %}
              &nbsp;
            {% endif %}
          </td>
        </tr>
        <tr>
          <td>
            <b>Submitted At</b>
          </td>
          <td>
            {{task.created_at|isodate}}
          </td>
        </tr>
      </tbody>
    </table>
  {% endif %}
  <span class="pull-right">
    <form class="icon" method="POST"
                       action="{{url_for('activate_all')}}">
      <input id="task_id" name="task_id" type="hidden" value="{{task.id}}">
      <button onclick="return safeConfirm('Are you sure you want to activate every record in this batch for processing?');"
              data-toggle="tooltip" data-placement="bottom"
              title="Activate all records for batch processing..." class="btn btn-info">Activate all
      </button>
    </form>
  </span>
  {{ super() }}
{% endblock %}
{% block list_row_actions %}
  {{ super() }}
    <div class="list-buttons-column">
      <a class="icon" href="{{ url_for('funding_contributor_list', funding_record_id=row.id, url=request.url) }}" title="Funding Contributor">
        <spam class="fa fa-users glyphicon glyphicon-users icon"></spam>
      </a>
      <a class="icon" href="{{ url_for('externalid_list', funding_record_id=row.id, url=request.url) }}" title="Funding ExternalId">
        <spam class="fa fa-external-link glyphicon glyphicon-users icon"></spam>
      </a>
    </div>
{% endblock %}
