{% extends "base.html" %}
{% load url from future %}
{% load i18n inline_formset %}
{% block content %}
<h2>{% trans "Merge" %}</h2>
<div class='form'>
<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Every operation on this form is irreversible"%}</label></p>
  <p>{% if previous_page %}<a href='{% url current_url 1 %}'>&Larr;</a><a href='{% url current_url previous_page %}'>&larr;</a>{% else %}&nbsp;{% endif %}
    {% trans "Page " %}{{current_page}}/{{max_page}}
{% if next_page %}<a href='{% url current_url next_page %}'>&rarr;</a><a href='{% url current_url max_page %}'>&Rarr;</a>{% else %}&nbsp;{% endif %} </p>
  <form action="." method="post">{% csrf_token %}
  {{formset.management_form}}
  {% for form in formset %}{% for hidden_field in form.hidden_fields %}{{hidden_field}}{% endfor %}{% endfor %}
  <table id='merge-table'>
    <thead>
      <tr>
        <th colspan='2'>{% trans "Item A" %}</th>
        <th colspan='2'>{% trans "Item B" %}</th>
        <th class='small'>{% trans "B is a duplicate of A" %}</th>
        <th class='small'>{% trans "A is a duplicate of B" %}</th>
        <th class='small'>{% trans "Is not duplicate" %}</th>
      </tr>
    </thead>
    <tbody>
      {% for form in formset %}
{% block merge_field_row %}
{% endblock %}
      {% endfor %}
    <tbody>
</table>
<input type="submit" value="{% trans "Validate" %}"/>
</form>
</div>
{% endblock %}
