From abc48f9e91fc117c8f6d0fcf7849ffca9489248b Mon Sep 17 00:00:00 2001 From: giorgia Date: Wed, 1 Mar 2017 21:09:03 +0100 Subject: [PATCH] add emptycontent div, show/hide emptycontent div, fix #1070 Signed-off-by: giorgia --- settings/js/users/users.js | 9 +++++++++ settings/templates/users/part.userlist.php | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/settings/js/users/users.js b/settings/js/users/users.js index db9f6b6006..8edc20e3e2 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -383,6 +383,7 @@ var UserList = { } UserList.currentGid = gid; var pattern = this.filter; + var emptyContainer = $userList.siblings('.emptycontent'); $.get( OC.generateUrl('/settings/users/users'), { offset: UserList.offset, limit: limit, gid: gid, pattern: pattern }, @@ -396,15 +397,22 @@ var UserList = { } UserList.add(user); }); + if (result.length > 0) { UserList.doSort(); $userList.siblings('.loading').css('visibility', 'hidden'); // reset state on load UserList.noMoreEntries = false; + $userListHead.show(); + emptyContainer.hide(); + emptyContainer.find('h2 strong').html(); } else { UserList.noMoreEntries = true; $userList.siblings('.loading').remove(); + $userListHead.hide(); + emptyContainer.show(); + emptyContainer.find('h2 strong').html(pattern); } UserList.offset += limit; }).always(function() { @@ -668,6 +676,7 @@ var UserList = { $(document).ready(function () { $userList = $('#userlist'); $userListBody = $userList.find('tbody'); + $userListHead = $userList.find('thead'); UserList.initDeleteHandling(); diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php index 4cf395ff62..12adbb9f30 100644 --- a/settings/templates/users/part.userlist.php +++ b/settings/templates/users/part.userlist.php @@ -67,3 +67,8 @@ + +