{% extends 'base.html' %}
{% block main %}
<div class="w3-row">
  <form class="w3-twothird" action="" method="POST">
    <button type="submit" style="" class="w3-btn w3-grey w3-round">Proceed</button>
    {% if form.action in safe_urls or form_is_local %}
      {% csrf_token %}
    {% endif %}
    {% if form.errors %}
    <div class="w3-red w3-padding">
        <strong>Errors found</strong> - please check the error messages below and try again
    </div>
    {% endif %}

    {% for field in form %}
        {% if field.type == "HiddenField" %}
            {{ field }}
        {% else %}
            <div id="{{ field.name }}-form" class="w3-row w3-padding w3-margin {% if field.errors %}w3-red{% else %}w3-gray{% endif %}">
              <div class="w3-col s3 w3-right-align">
                {{ field.label }}
              </div>
              <div class="w3-col s5 w3-left-align" style="padding-left: 10px">
                {{ field }}
              </div>
              <div class="w3-col s4 w3-left-align">
                  {% for error in field.errors %}
                      <ul class="error-block">
                          {{ error }}
                      </ul>
                  {% endfor %}
              </div>
            </div>
        {% endif %}
    {% endfor %}
    <button type="submit" style="margin-bottom: 20px" class="w3-btn w3-grey w3-round">Proceed</button>
  </form>
  <div class="w3-third">
    <h2>List with Payment Objects</h2>
    {% for payob in payoblist %}
      <ul class="w3-left-align">
        <a href="{% url "paymentob" id=payob.id %}"><li class="w3-grey">{{ payob.id }} - {{ payob.variant }} - <span title="{{ payob.message }}">{{ payob.status }}</span></li></a>
      </ul>
    {% endfor %}
  </div>
</div>
{% endblock %}
