view kallithea/templates/admin/users/users.html @ 6877:c5bff92d5084

templates: disable paging and page size controls in DataTables Since all data is sent to the client side, it can just as well be rendered. PageDown or scrolling is more convenient for paging than paging buttons, so short of "infinite scrolling", showing all entries is an acceptable solution ... especially when it very rarely is hundres of entries. There could perhaps be further changes to how DataTables is shown - this is one step.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 14 Sep 2017 02:08:06 +0200
parents ca4ab5047f74
children ff5c4b26461a
line wrap: on
line source

## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>

<%block name="title">
    ${_('Users Administration')}
</%block>

<%def name="breadcrumbs_links()">
    ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="user_count">0</span> ${_('Users')}
</%def>

<%block name="header_menu">
    ${self.menu('admin')}
</%block>

<%def name="main()">
<div class="panel panel-primary">
    <div class="panel-heading clearfix">
        <div class="pull-left">
            ${self.breadcrumbs()}
        </div>
        <div class="pull-right">
            <a href="${h.url('new_user')}" class="btn btn-success btn-xs"><i class="icon-plus"></i> ${_('Add User')}</a>
        </div>
    </div>
    <div class="panel-body">
        <table class="table" id="datatable_list_wrap" width="100%"></table>
    </div>
</div>

<script>
    var data = ${h.js(c.data)};
    var $dataTable = $("#datatable_list_wrap").DataTable({
        data: data.records,
        columns: [
            {data: "gravatar", sortable: false, searchable: false},
            {data: "username", title: ${h.jshtml(_('Username'))}},
            {data: "firstname", title: ${h.jshtml(_('First Name'))}},
            {data: "lastname", title: ${h.jshtml(_('Last Name'))}},
            {data: "last_login_raw", visible: false, searchable: false},
            {data: "last_login", title: ${h.jshtml(_('Last Login'))}, orderData: 4, searchable: false},
            {data: "active", title: ${h.jshtml(_('Active'))}, searchable: false, 'sType': 'str'},
            {data: "admin", title: ${h.jshtml(_('Admin'))}, searchable: false, 'sType': 'str'},
            {data: "extern_type", title: ${h.jshtml(_('Auth Type'))}, searchable: false},
            {data: "action", title: ${h.jshtml(_('Action'))}, searchable: false, sortable: false}
        ],
        order: [[1, "asc"]],
        drawCallback: updateRowCountCallback($("#user_count")),
        dom: '<"dataTables_left"f><"dataTables_right"i>t',
        paging: false,
    });
</script>

</%def>