{% load i18n %}
{% block cell-content %}
  <div class="wcs-tracking-code-input">
    {% block title %}
      <h2>{% if german_page %}Verfolgungscode{% else %}{% trans 'Tracking Code' %}{% endif %}</h2>
    {% endblock %}
    <div>
      {% block form-pre %}{% endblock %}
      <form data-wcs-url="{{ url }}" method="post" action="{{ site_base }}{% url 'wcs-tracking-code' %}">
        {% block form-top %}
          {% block intro-text %}
            <p>
              {% if german_page %}
                Ein Verfolgungscode kann Ihren Anfragen zugeordnet werden, um den
                Austausch mit den Diensten zu erleichtern.
              {% else %}

                {% blocktrans trimmed %}
                  A tracking code is attached to all your forms, it is there to help you in
                  dealing with the administration.
                {% endblocktrans %}
              {% endif %}
            </p>
            <p>
              {% if german_page %}
                Um eine Anfrage mit einem Verfolgungscode zu finden, geben Sie diesen
                unten ein:
              {% else %}
                {% blocktrans trimmed %}
                  To find the details of a form linked to a tracking code, you can enter the
                  code in the entry below:
                {% endblocktrans %}
              {% endif %}
            </p>
          {% endblock %}
        {% endblock %}
        <input id="_cell_url_{{ cell.id }}" name="url" value="" type="hidden"/>
        <input name="cell" value="{{ cell.id }}" type="hidden"/>
        <div id="_cell_error_{{ cell.id }}" class="errornotice" style="display: none">
          {% trans "The tracking code could not been found." %}
        </div>
        <label class="sr-only" for="tracking-code-{{cell.id}}">{% trans "Tracking Code" %}</label>
        <input required class="tracking-code--input" id="tracking-code-{{cell.id}}" name="code" placeholder="{% block input-placeholder-content %}{% trans 'ex: CNPHNTFB' %}{% endblock %}"/>
        <button aria-label="{% if german_page %}Bestätigen{% else %}{% trans 'Submit' %}{% endif %}">{% block submit-content %}{% if german_page %}Bestätigen{% else %}{% trans 'Submit' %}{% endif %}{% endblock %}</button>
        <script>
          $(function() {
            $('#_cell_url_{{ cell.id }}').val(window.location);
            if (window.location.search.indexOf('unknown-tracking-code') != -1) {
              $('#_cell_error_{{ cell.id }}').show();
            }
          });
        </script>
        {% block form-bottom %}{% endblock %}
      </form>
      {% block form-post %}{% endblock %}
    </div>
  </div>
{% endblock %}

