{% macro filelist(files) %}
    <table class="table table-hover">
        <thead>
        <tr>
            <th>Filename</th>
            <th>Type</th>
            <th class="text-right">Size</th>
            <th>Uploaded</th>
            <th>Actions</th>
        </tr>
        </thead>
        <tbody>
            {% for file in files %}
            <tr>
                <td><a href="{{ url_for('bepasty.display', name=file['id']) }}">{{ file['filename'] }}</a></td>
                <td>{{ file['type'] }}</td>
                <td class="text-right">{{ file['size'] }}</td>
                <td>{{ file['timestamp-upload'] | datetime }}</td>
                <td>
                    <a href="{{ url_for('bepasty.display', name=file['id']) }}">display</a>
                    <a href="{{ url_for('bepasty.download', name=file['id']) }}">download</a>
                    <a href="{{ url_for('bepasty.inline', name=file['id']) }}">inline</a>
                    <a href="{{ url_for('bepasty.delete', name=file['id']) }}">delete</a>
                    {% if may(ADMIN) %}
                    {% if not file['locked'] %}
                        <a href="{{ url_for('bepasty.lock', name=file['id']) }}">lock</a>
                    {% else %}
                        <a href="{{ url_for('bepasty.unlock', name=file['id']) }}">unlock</a>
                    {% endif %}
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}
