{% extends "sysadmin/base.html" %}
{% load seahub_tags i18n %}

{% block cur_org %}tab-cur{% endblock %}

{% block right_panel %}
<h3>{% trans "All Organizations" %}</h3>
{% if orgs %}
<table>
    <tr>
        <th width="20%">{% trans "Name" %}</th>
        <th width="18%">{% trans "Url Prefix" %}</th>
        <th width="27%">{% trans "Creator" %}</th>
        <th width="23%">{% trans "Created At" %}</th>
        <th width="12%">{% trans "Operations" %}</th>
    </tr>
    {% for org in orgs %}
    <tr>
        <td><a href="{% url 'sys_org_info' org.org_id %}">{{ org.org_name }}</a></td>
        <td>{{ org.url_prefix }}</td>
        <td>{{ org.creator }}</td>
        <td>{{ org.ctime|tsstr_sec }}</td>
        <td><a href="#" data-url="{{ SITE_ROOT}}org/remove/{{ org.org_id }}/" data-target="{{ org.org_name }}" class="remove-btn op vh">{% trans "Delete" %}</a></td>
    </tr>
    {% endfor %}
</table>

{% include "snippets/admin_paginator.html" %}

{% else %}
<p>{% trans "None." %}</p>
{% endif %}
{% endblock %}

{% block extra_script %}
<script type="text/javascript">
addConfirmTo($('.remove-btn'), {
        'title':'{% trans "Delete Organization" %}',
        'con':'{% trans "Are you sure you want to delete %s ?" %}'
});
</script>
{% endblock %}
