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

{% if items %}

<table class="listing">
<tr>
    <th class="highlight">{% trans "Title" %}</th>
    <th>{% trans "Digitized" %}</th>
    <th>{% trans "Recordist" %}</th>
    {% if location_name %}
    <th>{% trans "Location" %}</th>
    {% else %}
    <th>{% trans "Country/Continent" %}</th>
    {% endif %}
    <th>{% trans "Year of recording" %}</th>
    <th>{% trans "Code" %}</th>
</tr>
{% for item in items %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
    <td class="highlight">
        <a href="{% url "telemeta-item-detail" item.public_id %}">{{ item }}</a>
    </td>
    <td align="center">
        {% if item.file %}
         <a href="{% url "telemeta-item-detail" item.public_id %}">
          <center><span class="glyphicon glyphicon-volume-up" style="font-size: 1.3em;"></span></center>
        {% endif %}
    </td>

    <td>{{ item.collector }}</td>
    {% if location_name %}
    <td>{{ item.location.name }}</td>
    {% else %}
    <td>{{ item.country_or_continent|default:'&nbsp;' }}</td>
    {% endif %}
    <td>
    {% if item.recorded_from_date %}
        {{ item.recorded_from_date.year }}
        {% if item.recorded_to_date and not item.recorded_to_date.year|equals:item.recorded_from_date.year %}
            - {{ item.recorded_to_date.year }}
        {% endif %}
    {% endif %}
    </td>
    <td>
        {{ item.code|default:item.old_code }}
    </td>
</tr>
{% endfor %}
</table>

{% else %}
    <p>{% trans "No item" %}</p>
{% endif %}

