filter.html 2.56 KB
Newer Older
jtchilders's avatar
jtchilders committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<!DOCTYPE html>
<html>
<head>
{% load staticfiles %}
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.5/css/jquery.dataTables.css" type="text/css" media="screen">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
function filterREGEX () {
    $('#db_list').DataTable().search(
        $('#global_filter').val(),
        true,
        false
    ).draw();
}

$(document).ready(function() {
    $('#db_list').DataTable({
         "iDisplayLength": 100,
         "order": [[ 0, "desc" ]],
         "columnDefs":[
               { "width": "85px", "targets": 5 },
               { "width": "35px", "targets": 0 },
               { "width": "50px", "targets": 4 },
               { "width": "50px", "targets": 7 },
               { "width": "50px", "targets": 8 }
            ],
      });

    $('#global_filter').on( 'keyup click', function () {
        filterREGEX();
    } );
} );
</script>
</head>

<body>
   Type here to search with a REGEX  <input type="text" id="global_filter"> </br></br>
   <table id='db_list' class='display'>
      <thead>
      <tr> <th id="id"> Job Num. </th>
           <th id="job_id"> Job ID </th>
           <th id="group_identifier"> Group ID </th>
           <th id="job_site"> Subjob Site  </th>
           <th id="total_jobs"> Num. Subjobs </th>
           <th id="time_received"> Start Time </th>
           <th id="state_current"> Job State </th>
           <th id="current_job"> Current Subjob </th>
           <th id="state_job"> Subjob State </th>
      </tr>
      </thead>
      <tbody>
{% if argo_jobs %}
      {% for job in argo_jobs %}
         <tr> <td class='dt-center'> <a href="{% url 'job_display' job.id %}" target="_blank"> {{ job.id }} </a> </td> 
              <td class='dt-center'> {{ job.job_id }} </td>
              <td class='dt-center'> {{ job.group_identifier }} </td>
              <td class='dt-center'> {{ job.job_site }} </td>
              <td class='dt-center'> {{ job.total_jobs }} </td>
              <td class='dt-center'> {{ job.time_received }} </td>
              <td class='dt-center'> {{ job.state_current }} </td>
              <td class='dt-center'> {{ job.current_job|add:"1" }} </td>
              <td class='dt-center'> {{ job.state_job }} </td>
         </tr>
      {% endfor %}
{% else %}
      <tr> <td> No Argo Jobs Found </td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>
{% endif %}
      </tbody>
   </table>



</body>
</html>