<!--Template lingo/combo custom-->
{% load i18n %}
{% block cell-content %}
  {% if regies %}
  <h2>{% trans "Basket" %}</h2>
    {% for regie_info in regies %}
      {% if regies|length != 1 %}
        <h3 class="regie-name">{{regie_info.regie.label}}</h3>
      {% endif %}
      <form action="{% url 'lingo-pay' %}" method="POST">
        {% csrf_token %}
        <input type="hidden" name="next_url" value="{{ cell.page.get_online_url }}" />
        <input type="hidden" name="regie" value="{{regie_info.regie.id}}" />
        <ul>
          {% for item in regie_info.items %}
            <li>
              <a class="lingo_item" width="40%" {% if item.source_url %}href="{{ item.source_url }}{% endif %}">
                {{ item.subject }}
              </a>
              <p class="lingo_item_price">
                {{ item.amount }} €
              </p>
              {% if item.user_cancellable %}
                <a class="lingo_cancelable" rel="popup" href="{% url 'lingo-cancel-item' pk=item.id %}">
                  ({% trans 'remove' %})
                </a>
              {% endif %}
            </li>
          {% endfor %}
          <li>
            <strong>{% trans "Total:" %}</strong> {{ regie_info.total }} €
          </li>
        </ul>
        <input id="pay" type="submit" value="{% trans "Pay" %}" />
        <a href="{{portal_url}}demarches" id="new-command">
          Commander un autre document
        </a>
      </form>
    {% endfor %}
  {% endif %}
{% endblock %}
