{% extends 'base.html' %}

{% block content %}
<div class="card mb-5">

    <div class="card-header text-center">
        <h2>{{template.title}}</h2>
    </div>

    <div class="card-body">
      <div class="container">
        <div class="row">
          <div class="col-6">
            <img src="{{template.main_image.image.url}}" class="img-fluid img-thumbnail" alt="Responsive image">
          </div>
          <div class="col-6">
            <p>{{template.description}}</p>
          </div>
        </div>

      </div>

      <div class="container">
        <form action="" method="POST" class="mt-5">
          {% csrf_token %}
          <div class="row mt-5">
            {% for field in form %}
                <div class="col-6  text-center">
                  <h3>{{field.label}}</h3>
                  {{field}}
                </div>
              {% if forloop.counter|divisibleby:"2" %} </div><div class="row mt-5">{% endif %}  
            {% endfor %}
          </div>
          <div class="row mt-5">
            <div class="col-6"></div>
            <div class="col-6 text-center">
              <button class="btn btn-lg btn-success" type="submit">Sprawdź dostępność</button>
            </div>
          </div>
        </form>
      </div>
      </div>
    </div>
</div>

{% endblock %}
