{% extends "sveedocuments/board/subbase_pages.html" %}
{% load i18n mptt_tags autobreadcrumb documents_admin %}

{% block board_content %}
    {% if perms.sveedocuments.add_page or perms.sveedocuments.change_page or perms.sveedocuments.delete_page %}
        <a class="secondary button right" href="{% url documents-page-add %}">{% trans "Add a new page" %}</a>
        <h2>{% trans "Pages" %}</h2>
        
        <ul class="list-tree-fluid clearfix">{% recursetree page_list %}
            <li>
                <div class="indicator">
                    <span class="has-tip" data-width="90" title="{{ node.get_visible_display }}"><i class="lsf">{% if node.visible %}view{% else %}ban{% endif %}</i></span>
                    <span class="has-tip" data-width="210" title="{% blocktrans with published=node.published|date:"d/m/Y H:i" %}Published on {{ published }}{% endblocktrans %}"><i class="lsf">calendar</i></span>
                </div>
                <div href="#" class="large radius button split dropdown">
                    <a href="{% url documents-page-edit node.slug %}">
                        {{ node.title }}
                    </a>
                    <span></span>{% comment %}Needed for the Foundation dropdown button{% endcomment %}
                    <ul>
                        <li><a href="{% url documents-page-add-child node.slug %}" title="{% blocktrans %}Add a new child page to this one{% endblocktrans %}">{% trans "New child page" %}</a></li>
                        <li><a href="{% url documents-page-delete node.slug %}" title="{% blocktrans %}Recursively delete this page and his children{% endblocktrans %}">{% trans "Delete" %}</a></li>
                    </ul>
                </div>
                <div class="clearfix"></div>
                {% if not node.is_leaf_node %}<ul class="children {% if not node.visible %}hidden_parent{% endif %}">{{ children }}</ul>{% endif %}
            </li>
        {% endrecursetree %}</ul>
    {% endif %}
{% endblock %}
