summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-07 15:51:30 +0100
committerGitHub <noreply@github.com>2017-03-07 15:51:30 +0100
commitb029ffca6230b36d329487b34adc7b5b4a9d3e72 (patch)
tree953a11c2b77b9ab8e0322c50f769c5434703a516 /settings
parent13c98fe6cdea9502cbd19753821045d1631777f6 (diff)
parent3afc16bf772465e80b9e9fdb728b55e32bbd7a7d (diff)
downloadnextcloud-server-b029ffca6230b36d329487b34adc7b5b4a9d3e72.tar.gz
nextcloud-server-b029ffca6230b36d329487b34adc7b5b4a9d3e72.zip
Merge pull request #3671 from nextcloud/1070-user-management-no-results
FIX: Add feedback on user settings when no results
Diffstat (limited to 'settings')
-rw-r--r--settings/js/users/users.js20
-rw-r--r--settings/templates/users/part.userlist.php5
2 files changed, 25 insertions, 0 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index db9f6b6006b..46bfea4b35c 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -10,6 +10,7 @@
var $userList;
var $userListBody;
+var $emptyContainer;
var UserDeleteHandler;
var UserList = {
@@ -396,15 +397,25 @@ 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').text('');
}
else {
UserList.noMoreEntries = true;
$userList.siblings('.loading').remove();
+
+ if (pattern !== ""){
+ $userListHead.hide();
+ $emptyContainer.show();
+ $emptyContainer.find('h2').html(t('settings', 'No user found for <strong>{pattern}</strong>', {pattern: pattern}));
+ }
}
UserList.offset += limit;
}).always(function() {
@@ -668,6 +679,8 @@ var UserList = {
$(document).ready(function () {
$userList = $('#userlist');
$userListBody = $userList.find('tbody');
+ $userListHead = $userList.find('thead');
+ $emptyContainer = $userList.siblings('.emptycontent');
UserList.initDeleteHandling();
@@ -899,6 +912,13 @@ $(document).ready(function () {
$(this).find('#default_quota').singleSelect().on('change', UserList.onQuotaSelect);
});
+ $('#newuser input').click(function() {
+ // empty the container also here to avoid visual delay
+ $emptyContainer.hide();
+ OC.Search = new OCA.Search($('#searchbox'), $('#searchresults'));
+ OC.Search.clear();
+ });
+
UserList._updateGroupListLabel($('#newuser .groups'), []);
var _submitNewUserForm = function (event) {
event.preventDefault();
diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php
index 4cf395ff62d..7e7e1561e2f 100644
--- a/settings/templates/users/part.userlist.php
+++ b/settings/templates/users/part.userlist.php
@@ -67,3 +67,8 @@
</tr>
</tbody>
</table>
+
+<div class="emptycontent" style="display:none">
+ <div class="icon-search"></div>
+ <h2></h2>
+</div>