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

{% for item in unitdata %}
<tr id="row-status-{{ item.unit.checksum }}">
<td>{{ item.unit.position }}</td>
<td>
{% with item.unit as unit %}
    {% include "unit-context.html" %}
{% endwith %}
{% get_location_links item.unit %}
</td>
<td>
<a href="{% url 'translate' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}?sid={{ search_id }}&amp;offset={{ item.offset }}" class="btn btn-xs btn-default pull-right flip" title="{% trans "Open in full editor" %}"><i class="fa fa-pencil"></i> {% trans "Edit" %}</a>
</td>
</tr>
<tr id="row-source-{{ item.unit.checksum }}">
<td></td>
<td colspan="2" class="translatetext">
{% if not user.profile.hide_source_secondary or not item.secondary %}
{% format_translation item.unit.source item.unit.translation.subproject.project.source_language search_match=search_query num_plurals=item.unit.translation.language.nplurals %}
{% endif %}
{% if item.secondary %}
{% for unit in item.secondary %}
<div class="form-group">
<label>{{ unit.translation.language }}</label>
{% format_translation unit.target unit.translation.language %}
</div>
{% endfor %}
{% endif %}
</td>
</tr>
<tr id="row-edit-{{ item.unit.checksum }}">
<td>
<i id="loading-{{ item.unit.checksum }}" class="fa fa-spinner fa-spin" style="display: none"></i>
<i id="status-{{ item.unit.checksum }}"></i>
</td>
<td colspan="2" class="translator">
<form action="{% url 'save_zen' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" method="post">
{% csrf_token %}
{{ item.form.checksum }}
{{ item.form.target }}
{{ item.form.fuzzy }} <label for="id_{{ item.unit.checksum }}_fuzzy">{% trans "Review" context "Message needs review" %}</label>
</form>
</td>
</tr>
{% endfor %}

{% if last_section %}
<tr><td colspan="3" id="last-section">
{% show_message 'info' _('You have reached end of translating.') %}
</td></tr>
{% endif %}
