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

{% block breadcrumbs %}
<li><a href="{% url 'languages' %}">{% trans "Languages" %}</a></li>
<li><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
{% endblock %}

{% block content %}

{% whiteboard_messages language=object %}

<ul class="nav nav-pills">
  <li class="active"><a href="#overview" data-toggle="tab">{% trans "Projects" %}</a></li>
  <li><a href="#information" data-toggle="tab">{% trans "Information" %}</a></li>
  <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=object.code %}" data-monthly="{% url 'monthly_activity' lang=object.code %}">{% trans "Activity" %}</a></li>
  <li><a href="#dicts" data-toggle="tab">{% trans "Glossaries" %}</a></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={{ object.code }}">{% trans "Failing checks" %}</a></li>
      <li><a href="{% url 'checks' %}?language={{ object.code }}&amp;ignored=true">{% trans "Ignored checks" %}</a></li>
    </ul>
   </li>
</ul>

<div class="tab-content">

<div class="tab-pane active" id="overview">
<table class="sort table">
<thead>
<tr>
<th>{% trans "Project" %}</th>
<th colspan="2">{% trans "Translated" %}</th>
<th colspan="2">{% trans "Words" %}</th>
</tr>
<tbody>
{% for prj in projects %}
<tr>
<th><a href="{% url 'project-language' lang=object.code project=prj.slug %}">{{ prj }}</a></th>
<td class="progress-cell">{% generic_progress prj.language_stats.0 %}</td>
<td class="percent">{{ prj.language_stats.0 }}%</td>
<td class="progress-cell">{% generic_progress prj.language_stats.1 %}</td>
<td class="percent">{{ prj.language_stats.1 }}%</td>
</tr>
{% endfor %}
</tbody>
</table>

</div>

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

<table class="table">
<tr>
<th>{% trans "Number of plurals" %}</th>
<td>{{ object.nplurals }}</td>
</tr>
<tr>
<th>{% trans "Plural type" %}</th>
<td>{{ object.get_plural_type_display }}</td>
</tr>
<tr>
<th>{% trans "Plural equation" %}</th>
<td><code>{{ object.pluralequation }}</code></td>
</tr>
<tr>
<th>{% trans "Text direction" %}</th>
<td>{{ object.get_direction_display }}</td>
</tr>
<tr>
<th>{% trans "Language code" %}</th>
<td>{{ object.code }}</td>
</tr>
</table>

</div>

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

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

<div class="tab-pane" id="dicts">
{% if dicts %}
<div class="list-group">
{% for dict in dicts %}
<a class="list-group-item" href="{% url 'show_dictionary' lang=object.code project=dict.slug %}">{{ dict }}</a>
{% endfor %}
</div>
{% else %}
{% show_message "info" _("There are no glossaries defined for this language.") %}
{% endif %}
</div>

</div>

{% endblock %}
