{% extends "sveedocuments/page_details/subbase.html" %}
{% load i18n mptt_tags documents_markup documents_utils %}

{% block sveedocuments_content %}<div{% if page_instance.level == 0 %} class="doc_root_page"{% endif %}>
    {% document_context page_instance %}
    <div class="small-12 medium-3 columns context-menu">
        {% if document_toc %}<div class="panel">
            <h3>{% trans "Table of content" %}</h3>
            {{ document_toc }}
        </div>{% endif %}
        
        {% with document_navigation as tree_descendants %}
        {% if tree_descendants %}<div class="panel">
            <h3>{% trans "Navigation" %}</h3>
            <ul class="tree_bulletlist">
                {% recursetree tree_descendants %}
                    <li{% if active_page_instance and active_page_instance.slug == node.slug %} class="active"{% endif %}>
                        <a href="{% url 'sveedocuments:page-details' node.slug %}">{{ node.title }}</a>
                        {% if not node.is_leaf_node %}
                            <ul class="children">
                                {{ children }}
                            </ul>
                        {% endif %}
                    </li>
                {% endrecursetree %}
            </ul>
        </div>{% endif %}
        {% endwith %}
    </div>
    <div class="small-12 medium-9 columns">
        {% include "sveedocuments/page_details/_action_menu.html" %}

        <div class="restructuredtext_container">
            {{ document_render }}
        </div>
        
        {% if attachments %}
            {% include 'sveedocuments/page_details/_page_attachments.html' %}
        {% endif %}
    </div>
</div>{% endblock %}
