{% 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 %}

{% whiteboard_messages 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_dictionary' 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" data-load="activity" data-yearly="{% url 'yearly_activity' lang=language.code project=project.slug %}" data-monthly="{% url 'monthly_activity' lang=language.code project=project.slug %}">{% trans "Activity" %}</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' %}?language={{ language.code }}&amp;project={{ project.slug }}">{% trans "Failing checks" %}</a></li>
      <li><a href="{% url 'checks' %}?language={{ language.code }}&amp;project={{ project.slug }}&amp;ignored=true">{% trans "Ignored checks" %}</a></li>
    </ul>
   </li>
</ul>

<div class="tab-content">

<div class="tab-pane active" id="overview">
{% include "snippets/list-objects.html" with objects=translations name_template="snippets/list-only-component-name.html" label=_("Component") %}
{% with translations as page_obj %}
{% include "paginator.html" %}
{% endwith %}
<p>{% include "legend.html" %}</p>
</div>

<div class="tab-pane" id="information">
{% with object=project %}
<table class="table table-striped">
{% include "project_info.html" %}
{% if licenses %}
<tr>
<th>{% trans "Translation license" %}</th>
<td colspan="2">{{ licenses }}</td>
</tr>
{% endif %}
{% include "project_stats.html" %}
</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>

{% include "activity-tab.html" %}

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

<form action="{% url 'search' project=project.slug lang=language.code %}" method="GET">
{{ search_form|crispy }}
<input type="submit" value="{% trans "Search" %}" class="btn btn-primary" />
</form>

</div>


</div>

{% endblock %}

