{% extends 'base_for_backbone.html' %}
{% load seahub_tags avatar_tags i18n %}
{% load url from future %}
{% load staticfiles %}

{% block sub_title %}{% trans "Organization" %} - {% endblock %}

{% block left_panel %}
<div class="side-tabnav">
    <h3 class="hd">{% trans "Organization" %}</h3>
    <ul class="side-tabnav-tabs">
        <li class="tab tab-cur"><a href="{% url 'pubrepo' %}" class="lib">{% trans "Libraries" %}</a></li>
        <li class="tab {% block cur_user %}{% endblock %}"><a href="{% url 'pubuser' %}" class="members">{% trans "Members" %}</a></li>
    </ul>
</div>
{% endblock %}

{% block right_panel %}
<div id="organization-repos">
    <div class="hd ovhd">
        <h3 class="fleft">{% trans "Libraries" %}</h3>
        <button id="repo-create" class="fright"><img src="{{ MEDIA_URL }}img/add.png" alt="" class="add vam" /><span class="vam">{% trans "New Library"%}</span></button>
    </div>

    <table class="repo-list hide">
        <thead>
            <tr>
                <th width="4%"></th>
                <th width="38%">{% trans "Name"%} <span class="by-name icon-caret-up cspt"></span></th>
                <th width="10%"><!--op--></th>
                <th width="14%">{% trans "Size"%}</th>
                <th width="18%">{% trans "Last Update"%} <span class="by-time icon-caret-down cspt"></span></th>
                <th width="16%">{% trans "Shared By"%}</th>
            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
    <img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
    <div class="empty-tips hide">
        <h2 class="alc">{% trans "No public library" %}</h2>
        <p>{% blocktrans %}You can create a public library by clicking "New Library" button, others can view and download this library.{% endblocktrans %}</p>
    </div>
</div>

{% include "js/dir-view.html" %}

{% endblock %}

{% block extra_script %}
{% include "js/lib-op-popups.html" %}
<script>
app["pageOptions"] = {
    site_root: "{{ SITE_ROOT }}",
    base_url: "{{ SITE_ROOT }}" + "home/my/",
    reposUrl: "{% url 'api2-repos' %}",
    pubReposUrl: "{% url 'api2-pub-repos' %}",
    current_user: "{{ request.user.username }}",
    csrfToken: "{{csrf_token}}",
    is_staff: {% if request.user.is_staff %} true {% else %} false {% endif %}
};
</script>
{% if debug %}
<script data-main="{% static "scripts/organization.js" %}" src="{% static "scripts/lib/require.js" %}"></script>
{% else %}
<script data-main="{% static "scripts/dist/group.js" %}" src="{% static "scripts/lib/require.js" %}"></script>
{% endif %}
{% endblock %}
