{% load i18n %}
{% load translations %}

<table class="sort table">
<thead>
<tr>
<th>{% if show_language == 1 %}{% trans "Language" %}{% else %}{% trans "Project" %}{% endif %}</th>
<th></th>
<th colspan="2">{% trans "Translated" %}</th>
<th class="col-words">{% trans "Words" context "Number of translated words" %}</th>
<th class="col-fuzzy">{% trans "Fuzzy" context "Number of fuzzy strings" %}</th>
<th class="col-checks">{% trans "Checks" context "Number of failing checks" %}</th>
<th class="col-suggestions">{% trans "Suggestions" context "Number of suggestions" %}</th>
<th class="sort-skip">
<div class="btn-group">
  <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="{% trans "Configure columns" %}">
    <i class="fa fa-columns"></i>
  </button>
  <ul class="dropdown-menu" id="columns-menu" role="menu">
    <li><a><label><input type="checkbox" id="toggle-words" checked="true"> {% trans "Words" context "Number of translated words" %}</label></a></li>
    <li><a><label><input type="checkbox" id="toggle-fuzzy" checked="true"> {% trans "Fuzzy" context "Number of fuzzy strings" %}</label></a></li>
    <li><a><label><input type="checkbox" id="toggle-checks" checked="true"> {% trans "Checks" context "Number of failing checks" %}</label></a></li>
    <li><a><label><input type="checkbox" id="toggle-suggestions" checked="true"> {% trans "Suggestions" context "Number of suggestions" %}</label></a></li>
  </ul>
</div>
</th>
</tr>
<tbody>
{% for trans in translations %}
{% with trans.get_translated_percent as percent and trans.get_fuzzy_percent as fuzzy and trans.failing_checks as checks and trans.get_non_translated as count and trans.get_failing_checks_percent as check_percent and trans.have_suggestion as suggestions %}
<tr>
<th><a href="{{ trans.get_absolute_url }}">{% if show_language == 1 %}{{ trans.language }}{% else %}{% if show_only_component %}{{ trans.subproject.name }}{% else %}{{ trans.subproject }}{% endif %}{% if show_language == 2 %} ({{ trans.language }}){% endif %}{% endif %}</a></th>
<td>{% if trans.is_user_locked %}<i class="fa fa-lock html-tooltip" data-placement="bottom" data-toggle="tooltip" data-title='{{ trans.get_lock_display }}'></a>{% endif %}</td>
<td class="progress-cell">{% translation_progress trans %}</td>
<td class="percent">{{ percent }}%</td>
<td class="percent col-words" title="{% blocktrans count words=trans.untranslated_words %}{{ words }} word to translate!{% plural %}{{ words }} words to translate!{% endblocktrans %}" >{{ trans.get_words_percent }}%</td>
<td class="percent col-fuzzy">
{% if fuzzy > 0 %}
<a href="{{ trans.get_translate_url }}?type=fuzzy" title="{% blocktrans count trans.fuzzy as count %}There is {{ count }} fuzzy string.{% plural %}There are {{ count }} fuzzy strings.{% endblocktrans %}">
{{ fuzzy }}%
</a>
{% else %}
{{ fuzzy }}%
{% endif %}
</td>
<td class="number col-checks">
{% if checks > 0 %}
<a href="{{ trans.get_translate_url }}?type=allchecks" title="{% blocktrans count checks as count %}There is {{ count }} failing check.{% plural %}There are {{ count }} failing checks.{% endblocktrans %}">
{{ checks }}
</a>
{% else %}
{{ checks }}
{% endif %}
</td>
<td class="number col-suggestions">
{% if suggestions > 0 %}
<a href="{{ trans.get_translate_url }}?type=suggestions" title="{% blocktrans count suggestions as count %}There is {{ count }} suggestion.{% plural %}There are {{ count }} suggestions.{% endblocktrans %}">
{{ suggestions }}
</a>
{% else %}
{{ suggestions }}
{% endif %}
</td>
<td>
{% if count > 0 %}
<a href="{{ trans.get_translate_url }}?type=untranslated" title="{% blocktrans count trans.get_non_translated as count %}There is {{ count }} not translated string.{% plural %}There are {{ count }} not translated strings.{% endblocktrans %}" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> {% trans "Translate" %}</a>
{% endif %}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>

{% include "legend.html" %}
