list.pt 1.89 KB
<div metal:use-macro="load: ../layout-menu.pt">

    <div metal:fill-slot="content" i18n:domain="user">
        <h1 i18n:translate="Users">Users</h1>

        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th i18n:translate="Email">Email</th>
                    <th i18n:translate="Username">Username</th>
                    <th i18n:translate="Status">Status</th>
                    <th i18n:translate="Last login">Last login</th>
                    <th i18n:translate="Registered date">Registered date</th>
                    <th colspan="2"/>
                </tr>
            </thead>
            <tbody>
                <tr tal:repeat="user users">
                    <td tal:content="user.email"/>
                    <td tal:content="user.user_name"/>
                    <td tal:condition="user.status" i18n:translate="Active">Active</td>
                    <td tal:condition="not user.status"/>
                    <td tal:condition="user.last_login_date"
                        tal:content="user.last_login_date.strftime('%d-%m-%Y
                        %H:%M:%S %z')"/>
                    <td tal:condition="not user.last_login_date"/>
                    <td tal:content="user.registered_date.strftime('%d-%m-%Y %H:%M:%S %z')"/>
                    <td>
                        <a href="/user/${user.id}" i18n:translate="Edit">Edit</a>
                    </td>
                    <td tal:condition="user.id > 1 and user.id != request.user.id">
                        <a href="/user/${user.id}/delete" i18n:translate="Delete">Delete</a>
                    </td>
                    <td tal:condition="user.id <= 1" i18n:translate="System">System</td>
                    <td tal:condition="user.id > 1 and user.id == request.user.id" i18n:translate="You">You</td>
                </tr>
            </tbody>
        </table>
    </div>

</div>