{% extends "admin/change_list.html" %}
{% load pages_tags i18n adminmedia %}

{% block extrahead %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}mezzanine/css/admin/page_tree.css">
<style>
.delete {width:10px; height:10px; margin:2px 4px 0 10px; display:block; float:right; background:url('{% admin_media_prefix %}img/admin/icon_deletelink.gif');}
.grappelli-delete {width:11px; height:11px; margin:4px 4px 0 10px; background:url('{% admin_media_prefix %}img/icons/icon-inline_item_tools-deletelink.png');}
.grappelli-delete:hover {background:url('{% admin_media_prefix %}img/icons/icon-inline_item_tools-deletelink-hover.png');}
</style>
<script>window.__page_ordering_url = '{% url admin_page_ordering %}';</script>
<script src="{{ STATIC_URL }}mezzanine/js/jquery-ui-1.8.14.custom.min.js"></script>
<script src="{{ STATIC_URL }}mezzanine/js/admin/page_tree.js"></script>
{% endblock %}

{% block content %}
{% models_for_pages as page_models %}
<div id="content-main">

    {% if has_add_permission %}
    <div id="addlist-primary">
        <select class="addlist">
            <option value="">{% trans "Add" %} ...</option>
            {% for model in page_models %}
			    {% set_model_permissions model %}
			    {% if model.perms.add %}
                <option value="{{ model.add_url }}">{{ model.name }}</option>
                {% endif %}
            {% endfor %}
        </select>
    </div>
    {% endif %}

    {% if cl.result_count == 0 %}
    <p class="paginator">0 {{ cl.opts.verbose_name_plural }}</p>
    {% else %}
    <div id="tree">{% page_menu "pages/menus/admin.html" %}</div>
    {% endif %}

</div>
{% endblock %}
