{% extends "fragments/default.html" %}

{% block navbar %}
{% include "fragments/navbar.html" with active="zones" %}
{% endblock %}


{% block content %}
    <h4>Zones</h4>
    {% if user.is_superuser %}
    <a href="{% url 'zone_create' %}" class="btn btn-info">Create zone</a>
    <br/><br/>
    {% endif %}
    <table class="table table-hover table-bordered table-condensed">
        <thead><tr><th>Zone</th><th></th></tr></thead>
        <tbody>
            {% for zone in zones %}
            <tr class="info">
                <td><a href="{%url 'zone_view' id=zone.id %}">{{ zone.name }}</a></td>
                <td width="1em">
                    <div class="btn-group btn-group-sm">
                        <a class="btn btn-default" href="{% url 'zone_edit' id=zone.id %}" title="Edit settings">
                          <span class="glyphicon electric glyphicon-edit"></span>
                        </a>
                    </div>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

{% endblock %}
