{% load i18n render_pager baseurl store_tags cache %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
<div class="translation-nav">
  {{ pager|render_pager }}
</div>
<div class="translate-form">
    <table cellpadding="0" cellspacing="0" class="translate-table" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
      <tr lang="{{ LANGUAGE_CODE }}">
        <th colspan="1" rowspan="1" class="translate-table-title translate-edit"></th>
        <th colspan="1" rowspan="1" class="translate-table-title translate-original"></th>
        <th colspan="1" rowspan="1" class="translate-table-title translate-translation"></th>
      </tr>
      {% for unit in units %}
      <tr class="{% cycle 'even' 'odd' %}{% ifequal unit form.instance %} translate-translation-row{% endifequal %}{% if unit.isfuzzy %} translate-translation-fuzzy{% endif %}"{% ifequal unit form.instance %} colspan="2"{% endifequal %}>
        <td{% ifequal unit form.instance %} class="translate-focus"{% endifequal %}>
          <a href="?unit={{ unit.id }}" id="editlink{{ unit.index }}" title="{% trans 'Edit translation' %}">
          <div class="translation-action">{{ unit.index }}</div>
          </a>
        </td>
        {% ifequal unit form.instance %}
          {% cache settings.CACHE_TIMEOUT unit_edit unit.id unit.mtime cantranslate cansuggest canreview alt_src_codes profile.id LANGUAGE_CODE %}
          {% render_unit_edit form %}
          {% endcache %}
        {% else %}
          {% cache settings.CACHE_TIMEOUT unit_view unit.id unit.mtime LANGUAGE_CODE %}
          {% render_unit_view unit %}
          {% endcache %}
        {% endifequal %}
      </tr>
      {% endfor %}
    </table>
</div>
<div class="translation-nav">
{{ pager|render_pager }}
</div>
