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

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

{% block left_panel %}{{block.super}}
<form action="{% url 'user_search' %}" method="get" class="side-search-form">
    <input type="text" name="email" class="input" value="" placeholder="{% trans "Search users..." %}" />
</form>
{% endblock %}

{% block right_panel %}
<div class="tabnav">
    <ul class="tabnav-tabs">
        <li class="tabnav-tab"><a href="{% url 'sys_useradmin' %}">{% trans "Database" %}</a></li>
        <li class="tabnav-tab tabnav-tab-cur"><a href="{% url 'sys_useradmin_ldap' %}">{% trans "LDAP" %}</a></li>
        <li class="tabnav-tab"><a href="{% url 'sys_useradmin_ldap_imported' %}">{% trans "LDAP(imported)" %}</a></li>
        {% if is_default_admin %}
        <li class="tabnav-tab"><a href="{% url 'sys_useradmin_admins' %}">{% trans "Admins" %}</a></li>
        {% endif %}
    </ul>
</div>

<table>
    <tr>
        <th width="40%">{% trans "Email" %}</th>
        <th width="25%">{% trans "Space Used / Quota" %}</th>
        <th width="35%">{% trans "Create At / Last Login" %}</th>
    </tr>

    {% for user in users %}
    <tr>
        <td data="{{user.id}}"><a href="{{ SITE_ROOT }}useradmin/info/{{ user.props.email }}/">{{ user.email }}</a></td>
        <td style="font-size:11px;">
            {{ user.space_usage|seahub_filesizeformat }} / 
            {% if user.space_quota > 0 %}
            {{ user.space_quota|seahub_filesizeformat }}
            {% else %}
            --
            {% endif %}
        </td>
        <td> -- / {% if user.last_login %}{{user.last_login|translate_seahub_time}} {% else %} -- {% endif %}</td>
    </tr>
    {% endfor %}
</table>

{% include "sysadmin/useradmin_paginator.html" %}
{% endblock %}

{% block extra_script %}
<script type="text/javascript">

</script>
{% endblock %}
