-
Notifications
You must be signed in to change notification settings - Fork 8
/
observation_list.html
80 lines (80 loc) · 2.73 KB
/
observation_list.html
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
76
77
78
79
80
{% extends 'base.html' %}
{% load staticfiles %}
{% block extra_css %}
<link href="{% static 'css/fluid_page.css' %}" rel="stylesheet">
{% endblock %}
{% load bootstrap4 %}
{% block content %}
<div class="row">
<div class="col-md-10 table-responsive">
{% if paginator.num_pages > 1 %}
<span class="float-left">
{% bootstrap_pagination page_obj extra=request.GET.urlencode %}
</span>
{% endif %}
<span class="float-right text-right">
{{ filter.qs.count }} observations<br/>
Last Update: <strong>{{ filter.qs.first.modified }}</strong>
</span>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Site</th>
<th>Enc.</th>
<th>Tel.</th>
<th>Start</th>
<th>End</th>
<th>Req.ID</th>
<th>Proposal</th>
<th>Instruments</th>
<th>Modified</th>
<th>Created</th>
</tr>
</thead>
<tbody class="border-bottom">
{% for obs in object_list %}
{% if obs.state == 'COMPLETED' %}
<tr class="table-success">
{% elif obs.state == 'CANCELED' %}
<tr class="table-secondary">
{% elif obs.state == 'FAILED' or obs.state == 'ABORTED' %}
<tr class="table-danger">
{% elif obs.state == 'IN_PROGRESS'%}
<tr class="table-warning">
{% else %}
<tr class="table-default">
{% endif %}
<td><a href="{% url 'observations:observation-detail' pk=obs.id %}" title="Observation detail">{{ obs.id }}</a></td>
<td>{{ obs.site }}</td>
<td>{{ obs.enclosure }}</td>
<td>{{ obs.telescope }}</td>
<td>{{ obs.start }}</td>
<td>{{ obs.end }}</td>
<td><a href="{% url 'requestgroups:request-detail' pk=obs.request.id %}" title="Request detail">{{ obs.request.id }}</a></td>
<td>{{ obs.request.request_group.proposal.id }}</td>
<td>{% for inst in obs.instrument_types %}{{ inst }}<br/>{% endfor %}</td>
<td>{{ obs.modified }}</td>
<td>{{ obs.created }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if paginator.num_pages > 1 %}
<span class="float-left">
{% bootstrap_pagination page_obj extra=request.GET.urlencode %}
</span>
{% endif %}
<span class="float-right text-right">
Last Update: <strong>{{ filter.qs.first.modified }}</strong><br/>
{{ filter.qs.count }} observations
</span>
</div>
<div class="col-md-2">
<form class="form" method="GET" action="{% url 'observations:observation-list' %}">
{% bootstrap_form filter.form exclude="end_after,end_before" %}
{% buttons submit="Filter" reset="Reset" %}{% endbuttons %}
</form>
</div>
</div>
{% endblock %}