From 20a8bb8edccd189ce8a40cabd78a2643d2c34c68 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 25 Apr 2012 17:30:11 -0400 Subject: Allow manipulating display name and email address from web ui --- src/com/gitblit/wicket/GitBlitWebApp.properties | 4 +++- src/com/gitblit/wicket/GitBlitWebApp_ja.properties | 6 +++++- src/com/gitblit/wicket/pages/EditUserPage.html | 2 ++ src/com/gitblit/wicket/pages/EditUserPage.java | 2 ++ src/com/gitblit/wicket/panels/UsersPanel.html | 2 ++ src/com/gitblit/wicket/panels/UsersPanel.java | 13 ++++++++++++- 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 295db8a3..57ccd68f 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -272,4 +272,6 @@ gb.proposalFailed = Sorry, {0} did not receive any proposal data! gb.proposalError = Sorry, {0} reports that an unexpected error occurred! gb.failedToSendProposal = Failed to send proposal! gb.userServiceDoesNotPermitAddUser = {0} does not permit adding a user account! -gb.userServiceDoesNotPermitPasswordChanges = {0} does not permit password changes! \ No newline at end of file +gb.userServiceDoesNotPermitPasswordChanges = {0} does not permit password changes! +gb.displayName = display name +gb.emailAddress = email address \ No newline at end of file diff --git a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties index ebf19abd..7e50bd8d 100755 --- a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties @@ -270,4 +270,8 @@ gb.noProposals = Sorry, {0} is not accepting proposals at this time. gb.noFederation = Sorry, {0} is not configured to federate with any Gitblit instances. gb.proposalFailed = Sorry, {0} did not receive any proposal data! gb.proposalError = Sorry, {0} reports that an unexpected error occurred! -gb.failedToSendProposal = Failed to send proposal! \ No newline at end of file +gb.failedToSendProposal = Failed to send proposal! +gb.userServiceDoesNotPermitAddUser = {0} does not permit adding a user account! +gb.userServiceDoesNotPermitPasswordChanges = {0} does not permit password changes! +gb.displayName = display name +gb.emailAddress = email address \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/EditUserPage.html b/src/com/gitblit/wicket/pages/EditUserPage.html index 9e30d9a8..1c076bd6 100644 --- a/src/com/gitblit/wicket/pages/EditUserPage.html +++ b/src/com/gitblit/wicket/pages/EditUserPage.html @@ -14,6 +14,8 @@ + +

 

diff --git a/src/com/gitblit/wicket/pages/EditUserPage.java b/src/com/gitblit/wicket/pages/EditUserPage.java index 103d672a..1b3a0745 100644 --- a/src/com/gitblit/wicket/pages/EditUserPage.java +++ b/src/com/gitblit/wicket/pages/EditUserPage.java @@ -222,6 +222,8 @@ public class EditUserPage extends RootSubPage { confirmPassword); confirmPasswordField.setResetPassword(false); form.add(confirmPasswordField.setEnabled(editCredentials)); + form.add(new TextField("displayName").setEnabled(editCredentials)); + form.add(new TextField("emailAddress").setEnabled(editCredentials)); form.add(new CheckBox("canAdmin")); form.add(new CheckBox("excludeFromFederation")); form.add(repositories); diff --git a/src/com/gitblit/wicket/panels/UsersPanel.html b/src/com/gitblit/wicket/panels/UsersPanel.html index aa59a498..0b7dd517 100644 --- a/src/com/gitblit/wicket/panels/UsersPanel.html +++ b/src/com/gitblit/wicket/panels/UsersPanel.html @@ -15,6 +15,7 @@ [users] + [display name] [access level] [team memberships] [repositories] @@ -23,6 +24,7 @@ [username] + [display name] [access level] [team memberships] [repositories] diff --git a/src/com/gitblit/wicket/panels/UsersPanel.java b/src/com/gitblit/wicket/panels/UsersPanel.java index 4b0edb34..ecf4537d 100644 --- a/src/com/gitblit/wicket/panels/UsersPanel.java +++ b/src/com/gitblit/wicket/panels/UsersPanel.java @@ -28,6 +28,7 @@ import org.apache.wicket.markup.repeater.data.ListDataProvider; import com.gitblit.GitBlit; import com.gitblit.models.UserModel; +import com.gitblit.utils.StringUtils; import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.pages.EditUserPage; @@ -59,8 +60,18 @@ public class UsersPanel extends BasePanel { final UserModel entry = item.getModelObject(); LinkPanel editLink = new LinkPanel("username", "list", entry.username, EditUserPage.class, WicketUtils.newUsernameParameter(entry.username)); - WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.username); + WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName()); item.add(editLink); + + if (StringUtils.isEmpty(entry.displayName)) { + item.add(new Label("displayName").setVisible(false)); + } else { + editLink = new LinkPanel("displayName", "list", entry.getDisplayName(), + EditUserPage.class, WicketUtils.newUsernameParameter(entry.username)); + WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName()); + item.add(editLink); + } + item.add(new Label("accesslevel", entry.canAdmin ? "administrator" : "")); item.add(new Label("teams", entry.teams.size() > 0 ? ("" + entry.teams.size()) : "")); item.add(new Label("repositories", -- cgit v1.2.3