{% extends "pbp_store/admin_base.html" %}
{% load url from future %}
{% load catalog_filters %}

{% block body %}
<h2>Subscriptions</h2>

<table class="table table-striped table-bordered">
    <thead>
    <tr>
        <th>Postal Code</th>
        <th>City</th>
        <th>State</th>
        <th>County</th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
    {% for postal_code in postal_codes %}
    <tr>
        <td><a href="{% url 'postal_code_edit' postal_code.zipcode %}" >{{postal_code.zipcode}}</a></td>
        <td>{{postal_code.city}}</td>
        <td>{{postal_code.state}}</td>
        <td>{{postal_code.county}}</td>
        <td>
            {% if perms.pbp_core.store_catalog_edit %}
            <a href="{% url 'postal_code_edit' postal_code.zipcode %}" >Edit</a>&nbsp;
            <a href="{% url 'postal_code_delete' postal_code.zipcode %}" >Delete</a>
            {% else %}
             n/a
            {% endif %}
        </td>
    </tr>
    {% empty %}
    <tr><td colspan="4">No Postal Codes.</td></tr>
    {% endfor %}
    </tbody>
</table>

{% endblock body %}
