{% extends "base_bootstrap.html" %}

{% load render_table from django_tables2 %}

{% block title %}Events{% endblock %}

{% block content %}

<div class="container-fluid">
  <div class="row">

    <div class="col-lg-12 col-md-12 col-sm-12">

    <h3>Events List</h3>

    <h4>({{table.rows|length}})</h4>

    {% if table.rows|length > 0 %}
    <div class="table-responsive table-body table-condensed">
      {% render_table table %}
    </div>
    {% endif %}

    </div>
  </div>
</div>

<div class="col-lg-12 col-md-12 col-sm-12">
  {% if form.errors %}
    <p class="error">ERROR</p>
  {% endif %}

  <form action="{% url "eventList" %}" method="post" id="form">{% csrf_token %}

  <table class="forms">
      {{ form.as_table }}
  </table>
  <input type="submit" value="Add Event" />
  </form>

</div>

{% endblock %}
