{% extends "page.html" %}

{% block title %}{{page_title}}{% endblock %}

{% block params %}
{{super()}}
data-base-url="{{base_url | urlencode}}"
data-notebook-path="{{notebook_path | urlencode}}"
data-terminals-available="{{terminals_available}}"
data-server-root="{{server_root}}"
{% endblock %}

{% block headercontainer %}
<span class="flex-spacer"></span>
{% endblock %}

{% block site %}

<!-- <ul class="breadcrumb">
  <li><a href="{{breadcrumbs[0][0]}}"><i class="fa fa-folder" alt="folder icon"></i></a></li>
{% for crumb in breadcrumbs[1:] %}
  <li><a href="{{crumb[0]}}">{{crumb[1]}}</a></li>
{% endfor %}
</ul>
 -->

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

  {% for content in contents.content %}
    {% if content.type == 'notebook' %}
      <li><a href="{{base_url}}voila/render/{{content.path.rpartition('.')[0]}}"><i class="fa fa-book"></i>{{content.name.rpartition('.')[0]}}</a></li>
    {% endif %}
    {% 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 %}
</ul>

{% endblock %}

{% block script %}
    {{super()}}
{% endblock %}


