<pagination ng-show="usercount > usersPerPage"
            total-items="usercount" ng-model="params.page"
            items-per-page="{{ usersPerPage }}"
            max-size="5"
            boundary-links="true" ng-change="pageChanged()"></pagination>

<div class="table-responsive">
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th><translate>username</translate>
                <pi-filter ng-model="params.usernameFilter"
                           ng-change="_getUsers('livesearch')"
                           ng-keypress="($event.which==13)?_getUsers():return"
                           ></pi-filter>
            </th>
            <th><translate>surname</translate>
                <pi-filter ng-model="params.surnameFilter"
                           ng-change="_getUsers('livesearch')"
                           ng-keypress="($event.which==13)?_getUsers():return"
                ></pi-filter>
            </th>
            <th><translate>givenname</translate>
                <pi-filter ng-model="params.givennameFilter"
                           ng-change="_getUsers('livesearch')"
                           ng-keypress="($event.which==13)?_getUsers():return"
                ></pi-filter>
            </th>
            <th><translate>email</translate>
                <pi-filter ng-model="params.emailFilter"
                           ng-change="_getUsers('livesearch')"
                           ng-keypress="($event.which==13)?_getUsers():return"
                ></pi-filter>
            </th>
            <th translate>phone</th>
            <th translate>mobile</th>
            <th translate>description</th>
            <th translate>id</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="user in userlist">
            <td><a ui-sref="user.details({username:user.username,
                    realmname:selectedRealm,
                    resolvername:user.resolver,
                    editable:user.editable})">
                {{ user.username }}</a></td>
            <td>{{ user.surname }}</td>
            <td>{{ user.givenname }}</td>
            <td><a href="mailto:{{ user.email }}">
                {{ user.email }}</a></td>
            <td>{{ user.phone }}</td>
            <td>{{ user.mobile }}</td>
            <td>{{ user.description }}</td>
            <td>{{ user.userid }}</td>
        </tr>
        </tbody>
    </table>
</div>
