From 43646dbf8de86dfa6408e064e6af0d8bc0b4b51c Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Mon, 18 Apr 2011 09:30:37 +0200 Subject: User management works, now we need some usability expert ... --- admin/js/users.js | 29 ++++++++++++++++++++++------- admin/templates/users.php | 4 ++-- 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'admin') diff --git a/admin/js/users.js b/admin/js/users.js index ad1555c95a1..6a9ae9fc114 100644 --- a/admin/js/users.js +++ b/admin/js/users.js @@ -23,7 +23,12 @@ $(document).ready(function(){ groups.push($(this).val()); } }); - $("#changegroups").prev().html( groups.join(", ")); + if( groups.length == 0 ){ + $("#changegroups").prev().html( ' ' ); + } + else{ + $("#changegroups").prev().html( groups.join(", ")); + } } else{ alert( "something went wrong! sorry!" ); @@ -38,10 +43,15 @@ $(document).ready(function(){ // Manipulating the page after crteating a user function userCreated( username, groups ){ + // We need at least a space for showing the div + if( groups == "" ){ + groups = '&nbps;'; + } + // Add user to table - var newrow = ''+username+''; - newrow = newrow+''+groups+''; - newrow = newrow+'edit | remove'; + var newrow = '
'+username+'
'; + newrow = newrow+'
'+groups+''; + newrow = newrow+'remove'; $("#usertable").append( newrow ); // Clear forms @@ -96,7 +106,7 @@ $(document).ready(function(){ //######################################################################### // Password (clicking on user name) - $("span[x-use='usernamespan']").live( "click", function(){ + $("div[x-use='usernamediv']").live( "click", function(){ if( togglepassword == "" || $(this).parent().parent().attr("x-uid") != togglepassword ){ togglepassword = $(this).parent().parent().attr("x-uid"); // Set the username! @@ -128,7 +138,7 @@ $(document).ready(function(){ }); // Groups - $("span[x-use='usergroupsspan']").live( "click", function(){ + $("div[x-use='usergroupsdiv']").live( "click", function(){ if( togglegroup == "" || $(this).parent().parent().attr("x-uid") != togglegroup){ togglegroup = $(this).parent().parent().attr("x-uid"); var groups = $(this).text(); @@ -161,7 +171,12 @@ $(document).ready(function(){ groups.push($(this).val()); } }); - $(this).html( groups.join(", ")); + if( groups.length == 0 ){ + $("#changegroups").prev().html( ' ' ); + } + else{ + $("#changegroups").prev().html( groups.join(", ")); + } $('#changegroups').hide(); togglegroup = ""; } diff --git a/admin/templates/users.php b/admin/templates/users.php index 509fca64103..e769dcd4fc5 100644 --- a/admin/templates/users.php +++ b/admin/templates/users.php @@ -35,8 +35,8 @@ "> - - +
+
remove -- cgit v1.2.3 'exclude-element-screenshot'>exclude-element-screenshot Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
aboutsummaryrefslogtreecommitdiffstats
blob: 600e27a04d69811aebf57a4721df2cf4cfcf9bbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102