summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-04-25 17:30:11 -0400
committerJames Moger <james.moger@gitblit.com>2012-04-25 17:30:11 -0400
commit20a8bb8edccd189ce8a40cabd78a2643d2c34c68 (patch)
tree0cfa82c53118b4237b986ba765daac12dd1a1921
parentfdefa2b1fd7e3a4349a4ee72599f5d390166be30 (diff)
downloadgitblit-20a8bb8edccd189ce8a40cabd78a2643d2c34c68.tar.gz
gitblit-20a8bb8edccd189ce8a40cabd78a2643d2c34c68.zip
Allow manipulating display name and email address from web ui
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp.properties4
-rwxr-xr-xsrc/com/gitblit/wicket/GitBlitWebApp_ja.properties6
-rw-r--r--src/com/gitblit/wicket/pages/EditUserPage.html2
-rw-r--r--src/com/gitblit/wicket/pages/EditUserPage.java2
-rw-r--r--src/com/gitblit/wicket/panels/UsersPanel.html2
-rw-r--r--src/com/gitblit/wicket/panels/UsersPanel.java13
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 @@
<tr><th><wicket:message key="gb.username"></wicket:message></th><td class="edit"><input type="text" wicket:id="username" id="username" size="30" tabindex="1" /></td></tr>
<tr><th><wicket:message key="gb.password"></wicket:message></th><td class="edit"><input type="password" wicket:id="password" size="30" tabindex="2" /></td></tr>
<tr><th><wicket:message key="gb.confirmPassword"></wicket:message></th><td class="edit"><input type="password" wicket:id="confirmPassword" size="30" tabindex="3" /></td></tr>
+ <tr><th><wicket:message key="gb.displayName"></wicket:message></th><td class="edit"><input type="text" wicket:id="displayName" size="30" tabindex="4" /></td></tr>
+ <tr><th><wicket:message key="gb.emailAddress"></wicket:message></th><td class="edit"><input type="text" wicket:id="emailAddress" size="30" tabindex="5" /></td></tr>
<tr><th><wicket:message key="gb.canAdmin"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="canAdmin" tabindex="6" /> &nbsp;<span class="help-inline"><wicket:message key="gb.canAdminDescription"></wicket:message></span></label></td></tr>
<tr><th><wicket:message key="gb.excludeFromFederation"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="excludeFromFederation" tabindex="7" /> &nbsp;<span class="help-inline"><wicket:message key="gb.excludeFromFederationDescription"></wicket:message></span></label></td></tr>
<tr><td colspan="2" style="padding-top:15px;"><h3><wicket:message key="gb.accessPermissions"></wicket:message> &nbsp;<small><wicket:message key="gb.accessPermissionsForUserDescription"></wicket:message></small></h3></td></tr>
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<String>("displayName").setEnabled(editCredentials));
+ form.add(new TextField<String>("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 @@
<img style="vertical-align: middle; border: 1px solid #888; background-color: white;" src="user_16x16.png"/>
<wicket:message key="gb.users">[users]</wicket:message>
</th>
+ <th class="left"><wicket:message key="gb.displayName">[display name]</wicket:message></th>
<th style="width:120px;"><wicket:message key="gb.accessLevel">[access level]</wicket:message></th>
<th style="width:140px;"><wicket:message key="gb.teamMemberships">[team memberships]</wicket:message></th>
<th style="width:100px;"><wicket:message key="gb.repositories">[repositories]</wicket:message></th>
@@ -23,6 +24,7 @@
<tbody>
<tr wicket:id="userRow">
<td class="left" ><span class="list" wicket:id="username">[username]</span></td>
+ <td class="left" ><span class="list" wicket:id="displayName">[display name]</span></td>
<td class="left" ><span class="list" wicket:id="accesslevel">[access level]</span></td>
<td class="left" ><span class="list" wicket:id="teams">[team memberships]</span></td>
<td class="left" ><span class="list" wicket:id="repositories">[repositories]</span></td>
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",