{% extends 'base.html.twig' %}

{% block body %}
    <h3>Index für <em>{{ url_path }}</em></h3>
    <div class="toolbar">
        {% if write %}
            <span class="toolbar-item">
                <a class="coolbar-button" href="{#{ create_dir }#}">
                    <img src="{{ asset('icon/create') }}"/>
                </a>
            </span>
            <span class="toolbar-item">
                <a class="toolbar-button" href="{#{ upload_file }#}">
                    <img />
                </a>
            </span>
        {% endif %}
    </div>
    <table><!-- Directory Index -->
        <tr>
            <th class="td-color"><a href="{#{ sort_standard_href }#}"><img class="list-icon" alt="[icon]" width="32" height="32" src="/static/icons/empty.svg" /></a></th>
            <th class="td-color"><a href="{#{ sort_name_href }#}">Name</a></th>
            <th class="td-color"><a href="{#{ sort_size_href }#}">Größe</a></th>
            <th class="td-color"><a href="{#{ sort_time_href }#}">Zuletzt geändert</a></th>
            <th class="td-color">Beschreibung</th>
            <th class="td-color"></th>
        </tr>
        <tr><td colspan="6"><strong><hr></strong></td></tr>
        {% if parent_url %}
            <tr>
                <td><img class="list-icom" width="24" height="24" alt="[icon]" src="{{ '' }}/static/icons/back.svg" /></td>
                <td><a href="{{ parent_url }}">Zurück</a></td>
                <td>-</td>
                <td>-</td>
                <td>-</td>
                <td><img class="list-icon" alt="icon" width="24" height="24" src="/static/icons/empty.svg" /></td>
            </tr>
        {% endif %}
        {% for entry in dir_entries %}
            <tr>
                <td>{% if entry.icon %}<img class="list-icon" alt="{{ entry.icon_alt }}" src="{{ entry.icon }}" width="24" height="24" />{% endif %}</td>
                <td><a href="{{ entry.href }}">{{ entry.name }}</a></td>
                <td>{{ entry.display_size }}</td>
                <td>{{ entry.last_modified }}</td>
                <td>{{ entry.description }}</td>
                <td>
                    {% if entry.delete %}
                        <a href="{{ entry.delete }}"<img class="list-icon" alt="[delete]" width="24" height="24" src="/static/icons/delete.svg" /></a>
                    {% else %}
                        <img class="list-icon" alt="" width="24" height="24" src="/static/icons/empty.svg">
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        <tr><td colspan="6"><strong><hr></strong></td></tr>
    </table>
{% endblock %}
