{% extends "tp_base_extended.html" %}

{% load i18n baseurl %}

{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}

{% block body.id %}fileindex{% endblock body.id %}

{% block bodyclass %}tpoverview{% endblock bodyclass %}


{% block content %}
{% if children %}
<!--! The statistics view -->
<div class="module-primary" lang="{{ LANGUAGE_CODE }}">
    <div class="bd">
        <table class="sortable stats" id="stats" cellpadding="5"
        cellspacing="0" width="100%" lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
            <thead>
                <tr>
                    <th class="stats">{{ stats_headings.name }}</th>
                    <th class="stats">{{ stats_headings.progress }}</th>
                    <th class="stats sorttable_numeric">{{ stats_headings.summary }}</th>
                    <th class="stats">{{ stats_headings.totalwords }}</th>
                </tr>
            </thead>
            <tbody class="stats">
                {% for item in children %}
                <tr class="item {% cycle 'even' 'odd' %}" title="{{ item.description }}">
                {% include "language/item_summary.html" %}
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endif %}
{% endblock content %}

{% block postcontent %}
{% include "translation_project/fileop_forms.html" %}
{% include "top_contributers_table.html" %}
{% endblock postcontent %}

{% block scripts_extra %}
{{ block.super }}
<script type="text/javascript" src='{{ "js/sorttable.js"|m }}'></script>
{% if upload %}
<script type="text/javascript">
$(document).ready(function() {
  $("select#id_upload_to_dir").parent().hide();
  $("input#id_file").change(function() {
    if (/\.zip$/.test($(this).val())) {
      $("select#id_upload_to").parent().hide();
      $("select#id_upload_to_dir").parent().show();
    } else {
      $("select#id_upload_to_dir").parent().hide();
      $("select#id_upload_to").parent().show();
    }
  });
});
</script>
{% endif %}
{% endblock %}
