{% extends 'desktop.html' %}

{% block header %}
{% endblock %}
      
{% block title %}Page{% endblock %}

{% block content %}
<h1>Page</h1>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive table-nonfluid" >

{% for item in page_list %}
    <tr>
        <td >
            <a href="/{{item.slug}}">{{item.slug}}</a>
        </td>
        <td>
            {% if perms.page.change_page %}<a class="btn btn-warning" href="{% url 'page_edit' item.slug %}"> <span class="glyphicon glyphicon-edit"> Edit</a>{% endif %}
        <td>
            {% if perms.page.delete_page %}
                <a class="btn btn-danger" href="{% url 'page_delete' item.slug %}"> <span class="glyphicon glyphicon-remove"> Delete </a>
            {% endif %}
        </td>

        </td>
    </tr>

{% endfor %}

{% if perms.churchnest_page.add_page %}
    <tr><td class="text-center" colspan="3">
        <a class="btn btn-primary" href="{% url 'page_add' %}" > <span class="glyphicon glyphicon-plus "></span>  Add </a>
    </td> </tr>
{% endif %}

</table>
</div>

{% endblock %}
