{% load seahub_tags i18n %}
<div class="repo-file-list-topbar ovhd">
    <p class="path fleft">
    {% trans "Current path: "%}
    {% for name, link in zipped %}
    {% if not forloop.last %}
    <a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}" class="dir-link">{{ name }}</a> /    
    {% else %}
    <span id="cur-dir-name">{{ name }}</span>
    {% endif %}
    {% endfor %}
    </p>
    <div class="repo-op fright">
        {% if user_perm == 'rw' %}
        <button id="upload-file" class="op-btn"><span class="icon-upload-alt"></span>{% trans "Upload"%}</button>
        <button id="add-new-dir" class="op-btn"><span class="icon-plus-sign-alt"></span>{% trans "New Directory"%}</button>
        {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %}
        {% else %}
        <button id="add-new-file" class="op-btn"><span class="icon-plus-sign-alt"></span>{% trans "New File"%}</button>
        {% endif %}
        {% endif %}

        {% if path != '/' %}
        {% if not repo.encrypted %}
        <button data-url="{% url 'get_shared_link' %}?repo_id={{ repo.id }}&p={{ path|urlencode }}&type=d" data-link="{{ dir_shared_link }}" data-token="{{fileshare.token}}" data-upload-url="{% url 'get_shared_upload_link' %}?repo_id={{ repo.id }}&p={{ path|urlencode }}" data-upload-link="{{ dir_shared_upload_link }}" data-upload-token="{{ uploadlink.token }}" class="op-btn" id="share-cur-dir"><span class="sf-icon-share"></span>{% trans "Share"%}</button>
        {% endif %}
        {% endif %}
    </div>
</div>

<table class="repo-file-list">
    <tr>
        <th class="select">
            <span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
        </th>
        <th class="star"></th>
        <th class="dirent-icon"></th>
        <th><span class="dirent-name">{% trans "Name"%} <span id="name-up" class="icon-caret-up cspt hide"></span> <span id="name-down" class="icon-caret-down cspt"></span></span></th>
        <th class="dirent-size">{% trans "Size"%}</th>
        <th class="dirent-update">{% trans "Last Update" %} <span id="time-up" class="icon-caret-up cspt hide"></span> <span id="time-down" class="icon-caret-down cspt"></span></th>
        <th class="dirent-op">{% trans "Operations"%}</th>
    </tr>
    {% include 'snippets/repo_dirents.html' %}
</table>
{% if dirent_more %}
<img class="dirent-more loading-tip" src="{{MEDIA_URL}}img/loading-icon.gif" alt="{% trans 'Loading...' %}" data-start="{{more_start}}" />
{% endif %}
