{% extends "base_new.html" %}

{% load pagination_tags %}

{% block title %}External Crossmatches List{% endblock %}

{% block content %}

<body bgcolor="#424242">

<div id="quickfollowup">
<nav id="navigation">
<ul>
<li><a HREF="../{% if listHeader %}../{% endif %}">home</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/1/">confirmed</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/2/">good</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/3/">possible</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/5/">attic</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/4/">eyeball</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/followup_quickview/8/">eyeball-fast-track</a></li>
<li><a HREF="..{% if listHeader %}/..{% endif %}/userlist/">custom</a></li>
{% if form_searchobject %}
<li>
{% if form_searchobject.errors %}
    <p style="color: red;">
        Please correct the error{{ form_searchobject.errors|pluralize }} below.
    </p>
{% endif %}

<form id="search_form" action="" method="post">{% csrf_token %}
    {{ form_searchobject.non_field_errors }}
    <div class="fieldWrapper">
    <p>
        {{ form_searchobject.searchText.errors }}
        {{ form_searchobject.searchText }}
    <input type="submit" value="Find Object" /></p>
    </div>
</form>
</li>
{% endif %}

</ul>
</nav>

<section id="table_layout">
<article id="followup_table">
<header id="followup_list">
<hgroup>
<h1>External Transient Crossmatches</h1>

<h2>({{table.rows.count}})</h2>
</hgroup>
</header>

<table class="followuplists_standardview">
{% autopaginate rows 100 %}

<tr>
  {% for column in table.columns %}
  <th>
    {% if column.sortable %}
      <a href="?sort={{ column.name_toggled }}">
        {{ column }}
      </a>
      {% if column.is_ordered_reverse %}
        <!-- <img src="../../../site_media/images/up.jpg" /> -->
      {% else %}
         <!-- <img src="../../../site_media/images/down.jpg" /> -->
      {% endif %}
    {% else %}
      {{ column }}
    {% endif %}
  </th>
  {% endfor %}
</tr>

{% for row in rows %}
  <tr>
  <td><a href="../candidate/{{ row.data.transient_object_id.id }}/">{{ row.data.transient_object_id.id|default_if_none:"" }}</a></td>
  <td><a href="{{ row.data.url }}">{{ row.data.external_designation|default_if_none:"" }}</a></td>
  <td>{{ row.data.type|default_if_none:"" }}</td>
  <td>{{ row.data.host_galaxy|default_if_none:"" }}</td>
  <td>{{ row.data.mag|floatformat:2 }}</td>
  <td>{{ row.data.discoverer|default_if_none:"" }}</td>
  <td>{{ row.data.matched_list|default_if_none:"" }}</td>
  <td>{{ row.data.other_info|default_if_none:"" }}</td>
  <td>{{ row.data.separation|floatformat:2 }}</td>
  <td>{{ row.data.comments|default_if_none:"" }}</td>
  <td>{{ row.data.transient_object_id.local_designation|default_if_none:"" }}</td>
  <td>{{ row.data.transient_object_id.ps1_designation|default_if_none:"" }}</td>
  <td>{{ row.data.transient_object_id.detection_list_id.name|default_if_none:"" }}</td>
  <td>{{ row.data.transient_object_id.ra_sex|default_if_none:"" }}</td>
  <td>{{ row.data.transient_object_id.dec_sex|default_if_none:"" }}</td>
  </tr>
{% endfor %}
{% paginate %}

</table>


</article>
</section>
{% endblock %}
</div>
