{% extends "layout.html" %}

{% block title %}
    {{ title_path }} {{ current_project|capitalize }} source code ({{ current_tag }}) - Bootlin Elixir Cross Referencer
{% endblock %}

{% block description -%}
    {%- if path == '' -%}
        Elixir Cross Referencer - explore {{ current_project|capitalize }} {{ current_tag }} source code in your browser.
    {%- else -%}
        Elixir Cross Referencer - source tree of {{ current_project|capitalize }} {{ current_tag -}} {{- '' if path|length <= 1 else ': ' + path[1:] }}
    {%- endif -%}
{%- endblock -%}

{% block main %}

<div class="lxrtree">
    <table>
        <tbody>
        {% if back_url is not none %}
            <tr>
                <td><a class="tree-icon icon-back" href="{{ back_url }}">Parent directory</a></td>
                <td><a tabindex="-1" class="size" href="{{ back_url }}"></a></td>
            </tr>
        {% endif %}
        {% for type, name, path, url, size in dir_entries %}
            <tr>
                <td>
                    <a class="tree-icon icon-{{- type if type != 'symlink' else 'blob' -}}"
                       href="{{ url }}">
                    {% if type == 'symlink' %}
                        {{ name }} -> {{  path }}
                    {% else %}
                        {{ name }}
                    {% endif %}
                    </a>
                </td>
                <td>
                    <a tabindex="-1" class="size" href="{{ url }}">
                    {% if size is not none %}
                        {{ size }} bytes
                    {% endif %}
                    </a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>

{% endblock %}
