{% extends "page.html" %}

{% block title %}Voila Home{% endblock %}

{% block body %}

    <main role="main" class="container filetree">

        <div class="my-3 p-3 bg-white rounded shadow-sm">
            <h6 class="border-bottom border-gray pb-2 mb-0">Select Notebook</h6>

            <ul class="voila-notebooks">
                {% if breadcrumbs | length > 1: %}
                    <li><a href="{{ breadcrumbs[-2][0] }}"><i class="fa fa-folder"></i>..</a></li>
                {% endif %}

                {% set files = contents.content | list %}

                {% for content in files %}
                    {% if content.type == 'directory' %}
                        <li><a href="{{ base_url }}voila/tree/{{ content.path }}"><i class="fa fa-folder"></i>{{ content.name }}</a></li>
                    {% endif %}
                    {% endfor %}
                {% for content in files %}
                    {% if content.type in ['notebook', 'file'] %}
                        <li><a href="{{ base_url }}voila/render/{{ content.path }}"><i class="fa fa-book"></i>{{ content.name }}</a></li>
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
  </main>


{% endblock %}
