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

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

{% block content %}
<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 %}
