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

{% if children %}

{% if hits %}
<p class="pagination">
{% blocktrans %}{{ resource.children_type|capitalize }} {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
</p>
{% endif %}

<table class="listing">
<tr>
    <th class="highlight">{% trans "Title" %}</th>
    <th width="5%">{% trans "Digitized" %}</th>
    <th>{% trans "Description" %}</th>
    <th>{% trans "Code" %}</th>
</tr>
{% for child in children %}
{% if child.code %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
    <td class="highlight">
        <a href="{% url "telemeta-resource-detail" resource.children_type child.public_id %}">{{ child.title }}</a>
    </td>
    <td>
      {% if child.has_mediafile %}
       <center><span class="glyphicon glyphicon-volume-up" style="font-size: 1.3em;"></span></center>
      {% endif %}
    </td>
    <td>{% if child.descriptions %}{{ child.descriptions|safe }}{% else %}{{ child.description|safe }}{% endif %}</td>
    <td>{{ child.code }}</td>
</tr>
{% endif %}
{% endfor %}
</table>

{% else %}
    <p>{% trans "No resource" %}</p>

{% endif %}
