{# webmode: debug #}
{% extends "layouts/base.kdl.j2" %}

{% set web_title = "File browser: " + path %}
{% set header_title = "Exploring: " + path %}

{% block head_extra %}
link rel="stylesheet" href="/static/styles/fileview.css"
{% endblock %}

{% block content %}
ul class="file-list" {
    {% if path.strip() and path.strip() != "." %}
        {% set parent_path = "/_files/" + (path | parentpath).strip("/") %}
        li class="dir up-item" {
            a href="{{ parent_path }}" class="up-button" {
                b "Up"
            }
        }
    {% endif %}
    {% for item in items %}
    li class="{{ item.type }}" {
        a href="{{ item.url }}" \
          "[{{ 'DIR ' if item.type == 'directory' else 'FILE' }}] " \
          "{{ item.name if item.type != "directory" else item.name + "/" }}" 
    }
    {% endfor %}
}
{% endblock %}
