{% extends "admin_base.html" %}
{% load i18n seahub_tags %}
{% block nav_publinkadmin_class %}class="cur"{% endblock %}

{% block main_panel %}
<h3>{% trans "All Public Links" %}</h3>
{% if publinks %}
<table>
    <tr>
        <th width="20%">{% trans "Name" %}</th>
        <th width="20%">{% trans "Owner" %}</th>
        <th width="20%">{% trans "Create At" %}</th>
        <th width="30%">{% trans "Count" %}</th>
        <th width="10%">{% trans "Operations" %}</th>
    </tr>
    {% for publink in publinks %}
    <tr>
        <td>{{ publink.name }}</td>
        <td>{{ publink.username }}</td>
        <td>{{ publink.ctime|translate_seahub_time }} </td>
        <td>{{ publink.view_cnt }}</td>
        <td><a class="op vh" href="{% url 'remove_shared_link' %}?t={{ publink.token }}">{% trans "Remove" %}</a>
</td>
    </tr>
    {% endfor %}
</table>

<div id="paginator">
    {% if current_page != 1 %}
    <a href="?page={{ prev_page }}&per_page={{ per_page }}">{% trans "Previous" %}</a>
    {% endif %}
    {% if page_next %}
    <a href="?page={{ next_page }}&per_page={{ per_page }}">{% trans "Next" %}</a>
    {% endif %}
    {% if current_page != 1 or page_next %}
    |
    {% endif %}
    <span>{% trans "Per page: " %}</span> 
    {% if per_page == 25 %}
    <span> 25 </span> 
    {% else %}
    <a href="?per_page=25" class="per-page">25</a>
    {% endif %}
    {% if per_page == 50 %}
    <span> 50 </span> 
    {% else %}
    <a href="?per_page=50" class="per-page">50</a>
    {% endif %}
    {% if per_page == 100 %}
    <span> 100 </span> 
    {% else %}
    <a href="?per_page=100" class="per-page">100</a>
    {% endif %}
</div>
{% else %}
<p>{% trans "Empty" %}</p>
{% endif %}
{% endblock %}

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

</script>
{% endblock %}
 
