{% extends "base.html" %}

{% block base %}
  <div class="container parks">
    <h1>Chicago Parks<small>List of Parks</small></h1>
    <div class="section">
      <table id="employees" style="max-height: 100%;">
      <thead>
        <tr>
          <th>Name</th>
          <th>Location</th>
          <th>&nbsp;</th>
        </tr>
      </thead>
      <tbody>
      {% for e in parks %}
      <tr>
        <td>{{ e.title }}</td>
        <td>{{ e.address }}</td>
        <td><a href="/parks/{{ e.id }}">Details</a></td>
      </tr>
      {% endfor %}
      </tbody>
      </table>
      <div style="display: grid; grid-template-columns: auto auto;">
      {% if prev_page %}
        <a class="button" href="?page={{ prev_page }}" title="prev page" style="justify-self: start;">&laquo; Previous</a>
      {% else %}
        <!-- for grid spacing -->
        <span>&nbsp;</span>
      {% endif %}
      {% if next_page %}
        <a class="button" style="justify-self: end;" title="next page" href="?page={{ next_page }}">Next &raquo;</a>
      {% endif %}
      </div>
    </div>
  </div>
{% endblock %}
