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

{% block body %}

<h2>Store Admin</h2>

{% if perms.pbp_core.store_catalog_edit or perms.pbp_core.store_catalog_view or perms.pbp_core.store_admin_orders %}
<h3>Menu</h3>
<ul>
    {% if perms.pbp_core.store_catalog_edit %}
        <li><a href="{% url 'person_add' %}">Add Author</a></li>
        <li><a href="{% url 'catalog_add_book' %}">Add Book</a></li>
        <li><a href="{% url 'catalog_add_map' %}">Add Map</a></li>
        <li><a href="{% url 'catalog_add_movie' %}">Add Movie</a></li>
        <li><a href="{% url 'catalog_add_subscription' %}">Add Subscription</a></li>
        <li><a href="{% url 'postal_code_add' %}">Add Postal Code</a></li>
    {% endif %}
    {% if perms.pbp_core.store_catalog_view %}
        <li><a href="{% url 'person_list' %}">Authors</a></li>
        <li><a href="{% url 'catalog_list' %}">Catalog</a></li>
        <li><a href="{% url 'postal_code_list' %}">Postal Codes</a></li>
    {% endif %}
    {% if perms.pbp_core.store_admin_orders %}
        <li><a href="{% url 'order_list' %}">Orders</a></li>
        <li><a href="{% url 'subscription_list' %}">Subscriptions</a></li>
    {% endif %}
</ul>
{% else %}
<h4>You don't have permission to view anything</h4>
{% endif %}

<h5>Current Permissions</h5>
<ul>
    <li><strong>View Catalog</strong>: {{perms.pbp_core.store_catalog_view}}</li>
    <li><strong>Edit Catalog</strong>: {{perms.pbp_core.store_catalog_edit}}</li>
    <li><strong>Mange Orders</strong>: {{perms.pbp_core.store_admin_orders}}</li>
</ul>
{% endblock body %}
