{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load translations %}

{% block breadcrumbs %}
<li><a href="{{ object.project.get_absolute_url }}">{{ object.project }}</a></li>
<li><a href="{{ object.get_absolute_url }}">{{ object.name }}</a></li>
<li><a href="{% url 'weblate.trans.views.show_source' project=object.project.slug subproject=object.slug %}">{% trans "source" %}</a></li>
<li><a href="{% url 'weblate.trans.views.review_source' project=object.project.slug subproject=object.slug %}">{% trans "review" %}</a></li>
{% endblock %}

{% block content %}

<h2>{% trans "Strings to review" %}</h2>

<span id="navi-toolbar" class="ui-widget-header ui-corner-all">
<span id="navi">
<a id="button-first" {% if sources.number == 1 %}class="button-disabled"{% endif %} href="?page=1&amp;letter={{ letter }}">{% trans "First" %}</a>
<a id="button-prev" {% if not sources.has_previous %}class="button-disabled"{% endif %} href="?page={{ sources.previous_page_number }}&amp;letter={{ letter }}">{% trans "Previous" %}</a>
<a id="button-pos">{% blocktrans with sources.number as position and sources.paginator.num_pages as total %}{{ position }} / {{ total }}{% endblocktrans %}</a>
<a id="button-next" {% if not sources.has_next %}class="button-disabled"{% endif %} href="?page={{ sources.next_page_number }}&amp;letter={{ letter }}">{% trans "Next" %}</a>
<a id="button-end" {% if sources.paginator.num_pages == sources.number %}class="button-disabled"{% endif %} href="?page={{ sources.paginator.num_pages }}&amp;letter={{ letter }}">{% trans "Last" %}</a>
</span>
</span>

{% if sources.object_list %}
<table>
<thead>
<tr>
<td></td>
<th>{% trans "Source" %}</th>
<th>{% trans "Failing checks" %}</th>
</tr>
</thead>
<tbody>
{% for source in sources.object_list %}
<tr>
<td class="expander">
<span class="ui-icon ui-icon-triangle-1-e expander-icon"></span>
</td>
<td class="translatetext expander">{{ source.source|fmttranslation }}</td>
<td>
{% with source.active_source_checks as checks %}
{% include "list-checks.html" %}
{% endwith %}
{% if source.get_source_comments.exists %}
<span class="check">{% trans "Comment" %}</span>
{% endif %}
</td>
</tr>
<tr class="hidden">
<td>
</td>
<td>
<table>
{% with source as unit %}
{% include "unit-details.html" %}
{% endwith %}
{% with source.get_source_comments as comments %}
{% if comments %}
<tr><th colspan="2">{% trans "User comments" %}</th></tr>
{% include "list-comments.html" %}
{% endif %}
{% endwith %}
</table>
</td>
<td>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "No matching source strings found!" %}</p>
{% endif %}

{% endblock %}
