{% load i18n %}
<table class="listing">
  <col />
  <col  />
  <col width="16%" />
  <thead>
    <tr class="table-headers">
      <th>
        {% if not is_searching %}
          <a href="{% url 'castvideo:index' %}{% if not ordering == "title" %}?ordering=title{% endif %}" class="icon icon-arrow-down-after {% if  ordering == "title" %}teal{% endif %}">
            {% trans "Title" %}
          </a>
        {% else %}
          {% trans "Title" %}
        {% endif %}
      </th>
      <th>{% trans "File" %}</th>
      <th>{% trans "Type" %}</th>
      <th>
        {% if not is_searching %}
          <a href="{% url 'castvideo:index' %}{% if not ordering == "-created" %}?ordering=-created{% endif %}" class="icon icon-arrow-down-after {% if  ordering == "-created" %}teal{% endif %}">
            {% trans "Uploaded" %}
          </a>
        {% else %}
          {% trans "Uploaded" %}
        {% endif %}
      </th>
    </tr>
  </thead>
  <tbody>
    {% for video in videos %}
      <tr>
        <td class="title">
          {% if choosing %}
            <h2><a href="{% url 'castvideo:chosen' video.id %}" class="media-choice">{{ video.title }}</a></h2>
          {% else %}
            <h2><a href="{% url 'castvideo:edit' video.id %}">{{ video.title }}</a></h2>
          {% endif %}
        </td>
        <td>
          {% if choosing %}
            {{ video.filename }}
          {% else %}
            <a href="{{ video.url }}" class="nolink">{{ video.filename }}</a>
          {% endif %}
        </td>
        <td>{{ video.type }}</td>
        <td><div class="human-readable-date" title="{{ video.created|date:"d M Y H:i" }}">{{ video.created|timesince }} ago</div></td>
      </tr>
    {% endfor %}
  </tbody>
</table>
