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

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

{% block right_panel %}
<h3 class="hd">{% trans "All Groups" %}</h3>

{% if groups %}
<table>
    <tr>
        <th width="30%">{% trans "Name" %}</th>
        <th width="30%">{% trans "Creator" %}</th>
        <th width="25%">{% trans "Create At" %}</th>
        <th width="15%">{% trans "Operations" %}</th>
    </tr>
    {% for group in groups %}
    <tr>
        <td>
            {% if group.org_id %}
            <a href="{% url 'sys_admin_group_info' group.id %}?org_id={{group.org_id}}">{{ group.props.group_name }}</a>
            <p style="font-size:11px;"><a href="{% url 'sys_org_info_user' group.org_id %}">({{group.org_name}})</a></p>
            {% else %}
            <a href="{% url 'sys_admin_group_info' group.id %}">{{ group.props.group_name }}</a>
            {% endif %}
        </td>
        <td>{{ group.props.creator_name }}</td>
        <td>{{ group.props.timestamp|tsstr_sec }}</td>
        <td><img src="{{MEDIA_URL}}img/rm.png" alt="" data-url="{% url 'group_remove' group.id %}" data-target="{{ group.props.group_name }}" class="rm-grp op-icon vh" title="{% trans "Delete" %}" /></td>
    </tr>
    {% endfor %}
</table>

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

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

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