{% extends "wooey/base.html" %}
{% load i18n %}
{% load wooey_tags %}
{% block center_content_class %}col-md-12 col-xs-12{% endblock center_content_class %}

{% block center_content %}
    <div class="page-header">
        <h3 id="wooey-job-list-title">{{ title }}</h3>
        <p id="wooey-job-list-description">{{ object_list|length }} job(s)</p>
    </div>

  <div class="row">
    <div class="col-sm-12 col-md-12">
<div class="panel panel-default">
  <div class="panel-body  panel-table">

      <table class="table table-striped table-hover table-responsive table-panel">
        <tr>
            <th>#</th>
            <th>Job</th>
            <th>Script</th>
            <th>Submitted</th>
            <th>Status</th>

        </tr>
          {% for job in object_list %}
        <tr>
            <td>{{ job.id }}</td>
            <td><a href="{% url 'wooey:celery_results' job_id=job.pk %}">{{ job.job_name }}</a></td>
            <td>{{ job.script_version.script.script_name }}</td>
            <td>{{ job.created_date|timesince }} </td>
            
            <td>
                
            {% if job.status == 'completed' %}
            <span class="label label-success"><span class="glyphicon glyphicon-ok"></span> Success</span>
            {% elif job.status == 'running' %}
            <span class="label label-success"><span class="glyphicon glyphicon-refresh spinning"></span> Executing</span>
            {% elif job.status == 'pending' %}
            <span class="label label-default"><span class="glyphicon time"></span> Queued</span>
            {% elif job.status == 'revoked' %}
            <span class="label label-danger"><span class="glyphicon glyphicon-stop"></span> Halted</span>
            {% elif job.status == 'submitted' %}
            <span class="label label-default"><span class="glyphicon glyphicon-hourglass"></span> Waiting</span>
            {% endif %}
                
            </td>
            
        </tr>
      {% endfor %}
    </table>

  </div>
  </div>

          </div>
  </div>


{% endblock %}



