{% extends "base.html" %}
{% load i18n %}
{% load translations %}
{% load crispy_forms_tags %}

{% block breadcrumbs %}
<li><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
{% endblock %}

{% block content %}

<ul class="nav nav-pills">
  <li class="active"><a href="#overview" data-toggle="tab">{% trans "Components" %}</a></li>
  <li><a href="#information" data-toggle="tab">{% trans "Information" %}</a></li>
  <li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
      {% trans "Files" %} <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <li><a href="{% url "download_component_list" name=object.slug %}?format=zip" title="{% trans "Download for offline translation." %}">{% blocktrans %}Download original translation files as ZIP file{% endblocktrans %}</a></li>
    </ul>
  </li>
</ul>

<div class="tab-content">

<div class="tab-pane active" id="overview">
{% include "snippets/list-objects.html" with objects=components label=_("Component") %}
</div>

<div class="tab-pane" id="information">

<table class="table table-striped">
<tr>
<th>{% trans "Number of components" %}</th>
<td colspan="2">{{ object.components.all|length }}</td>
</tr>
{% include "project_stats.html" with stats=object.stats %}
{% for auto in object.autocomponentlist_set.all %}
<tr>
<th>{%if forloop.first%}{% trans "Automatic component list assignment" %}{% endif %}</th>
<td><code>project ~= {{ auto.project_match }}</code></td>
<td><code>component ~= {{ auto.component_match }}</code></td>
</tr>
{% endfor %}
</table>

</div>

</div>

{% endblock %}
