]> source.dussan.org Git - gitblit.git/commitdiff
Allow manipulating display name and email address from manager app
authorJames Moger <james.moger@gitblit.com>
Wed, 25 Apr 2012 21:39:18 +0000 (17:39 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 25 Apr 2012 21:39:18 +0000 (17:39 -0400)
src/com/gitblit/client/EditUserDialog.java
src/com/gitblit/client/UsersTableModel.java

index f3665d9bc35f160d835b6c8cc7be88de4618c046..d78924c4387487736c1c459a44d9c3f61571b63c 100644 (file)
@@ -72,6 +72,10 @@ public class EditUserDialog extends JDialog {
        private JPasswordField passwordField;\r
 \r
        private JPasswordField confirmPasswordField;\r
+       \r
+       private JTextField displayNameField;\r
+       \r
+       private JTextField emailAddressField;\r
 \r
        private JCheckBox canAdminCheckbox;\r
 \r
@@ -119,7 +123,9 @@ public class EditUserDialog extends JDialog {
                passwordField = new JPasswordField(anUser.password == null ? "" : anUser.password, 25);\r
                confirmPasswordField = new JPasswordField(anUser.password == null ? "" : anUser.password,\r
                                25);\r
-               canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), anUser.canAdmin);\r
+               displayNameField = new JTextField(anUser.displayName == null ? "" : anUser.displayName, 25);\r
+               emailAddressField = new JTextField(anUser.emailAddress == null ? "" : anUser.emailAddress, 25);\r
+               canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), anUser.canAdmin);           \r
                notFederatedCheckbox = new JCheckBox(\r
                                Translation.get("gb.excludeFromFederationDescription"),\r
                                anUser.excludeFromFederation);\r
@@ -128,6 +134,8 @@ public class EditUserDialog extends JDialog {
                fieldsPanel.add(newFieldPanel(Translation.get("gb.username"), usernameField));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.password"), passwordField));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.confirmPassword"), confirmPasswordField));\r
+               fieldsPanel.add(newFieldPanel(Translation.get("gb.displayName"), displayNameField));\r
+               fieldsPanel.add(newFieldPanel(Translation.get("gb.emailAddress"), emailAddressField));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.canAdmin"), canAdminCheckbox));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.excludeFromFederation"),\r
                                notFederatedCheckbox));\r
@@ -284,6 +292,9 @@ public class EditUserDialog extends JDialog {
                        // no change in password\r
                        user.password = password;\r
                }\r
+               \r
+               user.displayName = displayNameField.getText().trim();\r
+               user.emailAddress = emailAddressField.getText().trim();\r
 \r
                user.canAdmin = canAdminCheckbox.isSelected();\r
                user.excludeFromFederation = notFederatedCheckbox.isSelected();\r
index fa86a13e6c7144938370103faf0e8ead6f05002e..c05230ea256a3570e264a7267aa0384c9522164b 100644 (file)
@@ -36,7 +36,7 @@ public class UsersTableModel extends AbstractTableModel {
        List<UserModel> list;\r
 \r
        enum Columns {\r
-               Name, AccessLevel, Teams, Repositories;\r
+               Name, Display_Name, AccessLevel, Teams, Repositories;\r
 \r
                @Override\r
                public String toString() {\r
@@ -69,6 +69,8 @@ public class UsersTableModel extends AbstractTableModel {
                switch (col) {\r
                case Name:\r
                        return Translation.get("gb.name");\r
+               case Display_Name:\r
+                       return Translation.get("gb.displayName");\r
                case AccessLevel:\r
                        return Translation.get("gb.accessLevel");\r
                case Teams:\r
@@ -97,6 +99,8 @@ public class UsersTableModel extends AbstractTableModel {
                switch (col) {\r
                case Name:\r
                        return model.username;\r
+               case Display_Name:\r
+                       return model.displayName;\r
                case AccessLevel:\r
                        if (model.canAdmin) {\r
                                return "administrator";\r