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

{% block breadcrumbs %}
<li><a href="{{ project.get_absolute_url }}">{{ project }}</a></li>
<li><a href="{% url 'project-language' project=project.slug lang=language.code %}">{{ language }}</a></li>
{% endblock %}

{% block content %}

{% announcements language=language project=project %}

<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 "Info" %}</a></li>
  <li><a href="#search" data-toggle="tab">{% trans "Search" %}</a></li>
  <li><a href="{% url 'show_glossary' project=project.slug lang=language.code %}">{% trans "Glossary" %}</a></li>
  <li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
      {% trans "Insights" %} <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
    <li><a href="#history" data-toggle="tab">{% trans "History" %}</a></li>
    <li><a href="#activity" data-toggle="tab">{% trans "Activity" %}</a></li>
    </ul>
  </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_lang_project"  project=project.slug lang=language.code %}?format=zip" title="{% trans "Download for offline translation." %}">{% blocktrans %}Download original translation files as ZIP file{% endblocktrans %}</a></li>
    </ul>
  </li>
  <li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
      {% trans "Tools" %} <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <li><a href="{% url 'checks' %}?lang={{ language.code }}&amp;project={{ project.slug }}">{% trans "Failing checks" %}</a></li>
    </ul>
   </li>
{% include "snippets/watch-dropdown.html" %}
</ul>

<div class="tab-content">

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

<div class="tab-pane" id="information">
{% with object=project %}
<table class="table table-striped table-autowidth">
{% include "project_info.html" %}
{% include "snippets/license_info.html" %}
{% include "project_stats.html" with stats=language_stats %}
</table>
{% endwith %}
</div>

<div class="tab-pane" id="history">
{% include "last-changes-content.html" %}
<a class="btn btn-primary" href="{% url 'changes' %}?{{ last_changes_url }}">{% trans "Browse all language changes" %}</a>
</div>

{% url 'yearly_activity' lang=language.code project=project.slug as yearly_activity %}
{% url 'monthly_activity' lang=language.code project=project.slug as monthly_activity %}
{% include "activity-tab.html" %}

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

<form action="{% url 'search' project=project.slug lang=language.code %}" method="GET">
{% include "snippets/search-form.html" %}
</form>

</div>


</div>

{% endblock %}
