<table class="ietf-table" width="100%">
<tr>
  <th width="9%" class="orderField orderField{{ submitted_date|yesno:"Active,Inactive,Reversed" }}">
    <a href="?order_by={{ submitted_date|default_if_none:"" }}submitted_date">Date</a>
  </th>
  <th width="15%" class="orderField orderField{{ from_raw_body|yesno:"Active,Inactive,Reversed" }}">
    <a href="?order_by={{ from_raw_body|default_if_none:"" }}from_raw_body">From</a>
  </th>
  <th width="15%" class="orderField orderField{{ to_body|yesno:"Active,Inactive,Reversed" }}">
    <a href="?order_by={{ to_body|default_if_none:"" }}to_body">To</a>
  </th>
  <th width="9%" class="orderField orderField{{ deadline_date|yesno:"Active,Inactive,Reversed" }}">
    <a href="?order_by={{ deadline_date|default_if_none:"" }}deadline_date">Deadline</a>
  </th>
  <th width="50%" class="orderField orderField{{ title|yesno:"Active,Inactive,Reversed" }}">
    <a href="?order_by={{ title|default_if_none:"" }}title">Title</a>
  </th>
</tr>

{% for liaison in object_list %}
<tr class="{% cycle oddrow,evenrow %}">
<td style="white-space:nowrap;">{{ liaison.submitted_date|date:"Y-m-d" }}</td>
<td>{{ liaison.from_body|escape }}</td>
<td>
{% if liaison.by_secretariat %}
  {% if liaison.submitter_email %}
    <a href="mailto:{{ liaison.submitter_email}}">{{ liaison.submitter_name|escape }}</a>
  {% else %}
    {{ liaison.submitter_name|escape }}
  {% endif %}
{% else %}
  {{ liaison.to_body|escape }}
{% endif %}
</td>
<td>
  {{ liaison.deadline_date|default:"--" }}
</td>
<td>
{% if liaison.by_secretariat %}
  {% for file in liaison.uploads_set.all %}
    <a href="https://datatracker.ietf.org/documents/LIAISON/{{ file.filename }}">{{ file.file_title|escape }}</a><br/>
  {% endfor %}
{% else %}
  <a href="{{ liaison.detail_id }}/">{{ liaison.title|escape }}</a>
{% endif %}
<span style="display: none" class="liaisonPK">{{ liaison.pk }}</span>
</td>
</tr>
{% endfor %}

</table>
