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

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

<table class="table table-striped table-bordered">
    <thead>
    <tr>
        <th>Image</th>
        <th>Name</th>
        <th>Title</th>
        <th>Description</th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
    {% for person in persons %}
    <tr>
        <td>{% thumbnail person.image "64x92" as im %}
            <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
            {% endthumbnail %}
        </td>
        <td>{{person.name}}</td>
        <td>{{person.title}}</td>
        <td>{{person.description}}</td>
        <td>
            {% if perms.pbp_core.store_catalog_edit %}
            <a href="{% url 'person_edit' person.slug %}" >Edit</a>&nbsp;
            <a href="{% url 'person_delete' person.slug %}" >Delete</a>
            {% else %}
             n/a
            {% endif %}
        </td>
    </tr>
    {% empty %}
    <tr><td colspan="4">No Authors.</td></tr>
    {% endfor %}
    </tbody>
</table>

<div>
    <a href="{% url 'person_add' %}">Add Author</a>
</div>
{% endblock body %}
