{% extends "sysadmin/sys_org_info_base.html" %}
{% load i18n seahub_tags %}
{% load url from future %}

{% block right_panel %}
<div class="tabnav">
    <ul class="tabnav-tabs">
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_user' org.org_id %}">{% trans "Members" %}</a></li>
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_group' org.org_id %}">{% trans "Groups" %}</a></li>
        <li class="tabnav-tab tabnav-tab-cur"><a href="{% url 'sys_org_info_library' org.org_id %}">{% trans "Libraries" %}</a></li>
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_setting' org.org_id %}">{% trans "Settings" %}</a></li>
    </ul>
</div>

{% if org_repos %}
    <table class="repo-list">
        <tr>
            <th width="4%"><!--icon--></th>
            <th width="31%">{% trans "Name" %}</th>
            <th width="25%">ID</th>
            <th width="25%">{% trans "Owner" %}</th>
            <th width="15%">{% trans "Operations" %}</th>
        </tr>
        {% for repo in org_repos %}
        <tr>
            {% if repo.encrypted %}
            <td><img src="{{MEDIA_URL}}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted"%}" alt="{% trans "directory icon" %}" /></td>
            {% else %}
            <td><img src="{{MEDIA_URL}}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write"%}" alt="{% trans "directory icon" %}" /></td>
            {% endif %}
            <td>{{ repo.name }}</td>
            <td style="font-size:11px;">{{ repo.id }}</td>
            <td>
                {% if repo.owner %}
                <a href="{{ SITE_ROOT }}useradmin/info/{{ repo.owner }}/">{{ repo.owner}}</a>
                {% else %}
                --
                {% endif %}
            </td>
            <td>
                <div>
                <a href="#" data-url="{% url "sys_repo_delete" repo.id %}" data-target="{{ repo.name }}" class="repo-delete-btn op vh">{% trans "Delete" %}</a>
                </div>
            </td>
        </tr>
        {% endfor %}
    </table>
{% else %}
<div class="empty-tips">
<h2 class="alc">{% trans "This organization doesn't have any libraries" %}</h2>
</div>
{% endif %}

{% endblock %}

{% block extra_script %}
<script type="text/javascript">
{% include 'sysadmin/sys_org_set_quota_js.html' %}
addConfirmTo($('.repo-delete-btn'), {
    'title': "{% trans "Delete Library" %}",
    'con': "{% trans "Are you sure you want to delete %s ?" %}",
    'post': true
});
</script>
{% endblock %}
