{% load telemeta_tags %}
{% load i18n %}

{% if collections %}

<table class="listing">
<tr>
    <th class="highlight">{% trans "Title" %}</th>
    <th>{% trans "Digitized" %}</th>
    <th>{% field_label "MediaCollection" "creator" %}</th>
    <th>{% trans "Recordist" %}</th>
    <th>{% trans "Recording period" %}</th>
    <th>{% trans "Code" %}</th>
</tr>
{% for collection in collections %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
    <td class="highlight">
        <a href="{% url "telemeta-collection-detail" collection.public_id %}">{{ collection.title }}</a>
    </td>
    <td>
      {% if collection.has_mediafile %}
       <center><span class="glyphicon glyphicon-volume-up" style="font-size: 1.3em;"></span></center>
      {% endif %}
    </td>

    <td>{{ collection.creator }}</td>
    <td>{{ collection.apparent_collector }}</td>
    <td>
    {% if collection.recorded_from_year %}
        {{ collection.recorded_from_year }}
        {% if collection.recorded_to_year and not collection.recorded_to_year|equals:collection.recorded_from_year %}
            - {{ collection.recorded_to_year }}
        {% endif %}
    {% endif %}
    </td>
    <td>
        {{ collection.code|default:collection.old_code }}
    </td>
</tr>
{% endfor %}
</table>
{% else %}
    <p>{% trans "No collection" %}</p>
{% endif %}

