9c84bb91f9cde70b07ba730ac04fe2f17089b2b4
[pharos.git] / tools / pharos-dashboard / templates / dashboard / dev_pods.html
1 {% extends "dashboard/table.html" %}
2 {% load staticfiles %}
3 {% load jenkins_filters %}
4
5 {% block table %}
6     <thead>
7     <tr>
8         <th>Name</th>
9         <th>Slave Name</th>
10         <th>Booked by</th>
11         <th>Booked until</th>
12         <th>Purpose</th>
13         <th>Status</th>
14         <th></th>
15     </tr>
16     </thead>
17     <tbody>
18     {% for pod, booking in dev_pods %}
19         <tr>
20             <th>
21                 <a href={% url 'dashboard:resource' resource_id=pod.id %}>{{ pod.name }}</a>
22             </th>
23             <th>
24                 <a target='_blank' href={{ pod.slave.url }}>{{ pod.slave.name }}</a>
25             </th>
26             <th>
27                 {{ booking.user.username }}
28             </th>
29             <th>
30                 {{ booking.end }}
31             </th>
32             <th>
33                 {{ booking.purpose }}
34             </th>
35             <th style="background-color:{{ pod.slave.status | jenkins_status_color }}">
36                 {{ pod.slave.status }}
37             </th>
38             <th>
39                 <a href="{% url 'booking:create' resource_id=pod.id %}" class="btn btn-primary">
40                     Book
41                 </a>
42             </th>
43         </tr>
44     {% endfor %}
45     </tbody>
46 {% endblock table %}
47
48 {% block tablejs %}
49     <script type="text/javascript">
50         $(document).ready(function () {
51             $('#table').DataTable({
52                 columnDefs: [
53                     {type: 'status', targets: 5}
54                 ],
55                 "order": [[5, "asc"]]
56             });
57         });
58     </script>
59 {% endblock tablejs %}