diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-27 13:42:23 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-10 19:00:05 -0400 |
commit | 53b312fdc03e797d751d73e79a58e2b2bb3f9e87 (patch) | |
tree | c3286d45a55b475595863550f3f3678dd4e31a3c /src/main/java/com/gitblit/transport | |
parent | ad897d62a28054dbc4b9d720417336129835f301 (diff) | |
download | gitblit-53b312fdc03e797d751d73e79a58e2b2bb3f9e87.tar.gz gitblit-53b312fdc03e797d751d73e79a58e2b2bb3f9e87.zip |
Simplify show user output
Diffstat (limited to 'src/main/java/com/gitblit/transport')
-rw-r--r-- | src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java index 0b83cecd..52aedbbd 100644 --- a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java +++ b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java @@ -25,7 +25,6 @@ import com.gitblit.Constants.AccessPermission; import com.gitblit.manager.IGitblit; import com.gitblit.models.RegistrantAccessPermission; import com.gitblit.models.RepositoryModel; -import com.gitblit.models.TeamModel; import com.gitblit.models.UserModel; import com.gitblit.transport.ssh.SshKey; import com.gitblit.transport.ssh.commands.CommandMetaData; @@ -273,28 +272,20 @@ public class UsersDispatcher extends DispatchCommand { UserModel u = getUser(true); // fields - String [] fheaders = new String [] { "Field", "Value" }; - Object [][] fdata = new Object[5][]; - fdata[0] = new Object [] { "Email", u.emailAddress }; - fdata[1] = new Object [] { "Type", u.accountType }; - fdata[2] = new Object [] { "Can Admin", u.canAdmin() ? "Y":"" }; - fdata[3] = new Object [] { "Can Fork", u.canFork() ? "Y":"" }; - fdata[4] = new Object [] { "Can Create", u.canCreate() ? "Y":"" }; - String fields = FlipTable.of(fheaders, fdata, Borders.COLS); + StringBuilder fb = new StringBuilder(); + fb.append("Email : ").append(u.emailAddress == null ? "": u.emailAddress).append('\n'); + fb.append("Type : ").append(u.accountType).append('\n'); + fb.append("Can Admin : ").append(u.canAdmin() ? "Y":"").append('\n'); + fb.append("Can Fork : ").append(u.canFork() ? "Y":"").append('\n'); + fb.append("Can Create : ").append(u.canCreate() ? "Y":"").append('\n'); + String fields = fb.toString(); // teams String teams; if (u.teams.size() == 0) { teams = FlipTable.EMPTY; } else { - String [] theaders = new String [] { "Team", "Type" }; - Object [][] tdata = new Object[u.teams.size()][]; - int i = 0; - for (TeamModel t : u.teams) { - tdata[i] = new Object [] { t.name, t.accountType }; - i++; - } - teams = FlipTable.of(theaders, tdata, Borders.COLS); + teams = Joiner.on(", ").join(u.teams); } // owned repositories |