Skip to content
Snippets Groups Projects
Commit 55c842b3 authored by Brian Moe's avatar Brian Moe
Browse files

Cleaned up latest page presentation.

parent a847b6d0
No related branches found
No related tags found
No related merge requests found
...@@ -935,7 +935,7 @@ def latest(request): ...@@ -935,7 +935,7 @@ def latest(request):
if form.is_valid(): if form.is_valid():
query = form.cleaned_data['query'] query = form.cleaned_data['query']
context['objects'] = Event.objects.filter(query).distinct().order_by("-created")[:10] context['objects'] = Event.objects.filter(query).distinct().order_by("-created")[:15]
context['error'] = False context['error'] = False
else: else:
context['error'] = True context['error'] = True
......
...@@ -97,45 +97,66 @@ ...@@ -97,45 +97,66 @@
</form> </form>
{% if objects %} {% if objects %}
<hr/> <table class="event">
{% for item in objects %} {% if skyalert_authorized %}
<div class="summary"> <tr><td colspan="4">
<div class="graceid"> <a href="{% url skyalert object.graceid %}"><button type="button">Submit to Skyalert</button></a>
<a href="{% url view item.graceid %}">{{ item.graceid }}</a> </td></tr>
| {% endif %}
{{item.group}}
{{item.get_analysisType_display}} <tr>
</div> <th valign="top">UID</th>
{% for log in item.eventlog_set.iterator %} <th>Labels</th>
<th>Group</th>
<th>Type</th>
<th>Instruments</th>
<th>
{{ "gps"|timeselect:"gps" }}
Event Time
</th>
<th>FAR (Hz)</th>
<th>Latency (sec)</th>
<th>
{{"created"|timeselect:"utc" }}
Created
</th>
<th></th>
</tr>
{% for object in objects %}
<tr class={% cycle 'odd' 'even' %}>
<td>{{ object.graceid }}</td>
<td>
{% for labelling in object.labelling_set.all %}
<span title="{{labelling.creator.name}} {{labelling.created|utc}}" style="color: {{labelling.label.defaultColor}}">{{ labelling.label.name }}</span>
{% endfor %}
</td>
<td>{{ object.group.name }} </td>
<td>{{ object.get_analysisType_display }} </td>
<td>{{ object.instruments }}</td>
<td>{% if object.gpstime%}
<!-- <span title="{{ object.gpstime|gpsdate }}">{{ object.gpstime }}</span> -->
{{ object.gpstime|multiTime:"gps" }}
{% endif %}</td>
<td>{{ object.far|scientific }}</td>
<td style="text-align:center">{{ object.reportingLatency }}</td>
<td>{{ object.created|multiTime:"created" }}</td>
<td>
{% for log in object.eventlog_set.iterator %}
{% if log.hasImage %} {% if log.hasImage %}
<div class="skymap"> <div class="skymap">
<a href="{{ log.fileurl }}" dojoType="dojox.image.LightboxNano"><img height="130" src="{{ log.fileurl }}"></a> <a href="{{ log.fileurl }}" dojoType="dojox.image.LightboxNano"><img height="50" src="{{ log.fileurl }}"></a>
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</td>
</tr>
<div class="labels"> {% endfor %}
{% for labelling in item.labelling_set.all %} </table>
<span class="label" title="{{labelling.creator.name}} {{labelling.created|utc}}" style="color: {{labelling.label.defaultColor}}">{{ labelling.label.name }}</span>
{% endfor %} {% else %} <!-- !objects -->
</div> <h1>No events.</h1>
{% endif %} <!-- if objects -->
<table>
<tr><th>FAR:</th>
<td> {{ item.far|scientific }} {% if item.far %}Hz{% endif %}</td></tr>
<tr><th>Event Time:</th>
<td> {{ item.gpstime }} </td></tr>
<tr><th>Latency:</th>
<td> {{ item.reportingLatency }} {% if item.reportingLatency %}seconds{% endif %}</td></tr>
<tr><th>IFOS:</th>
<td> {{ item.instruments }} </td></tr>
<tr><th>Created:</th>
<td> {{ item.created|utc }} </td></tr>
</table>
</div><!-- class summary -->
{% endfor %}
{% endif %}
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment