|
28 | 28 | import org.apache.wicket.markup.html.form.DropDownChoice;
|
29 | 29 | import org.apache.wicket.markup.html.form.Form;
|
30 | 30 | import org.apache.wicket.markup.html.form.IChoiceRenderer;
|
| 31 | +import org.apache.wicket.markup.html.panel.Fragment; |
31 | 32 | import org.apache.wicket.markup.repeater.Item;
|
32 | 33 | import org.apache.wicket.markup.repeater.OddEvenItem;
|
33 | 34 | import org.apache.wicket.markup.repeater.RefreshingView;
|
34 | 35 | import org.apache.wicket.markup.repeater.util.ModelIteratorAdapter;
|
35 | 36 | import org.apache.wicket.model.CompoundPropertyModel;
|
36 | 37 | import org.apache.wicket.model.IModel;
|
| 38 | +import org.eclipse.jgit.lib.PersonIdent; |
37 | 39 |
|
38 | 40 | import com.gitblit.Constants.AccessPermission;
|
39 | 41 | import com.gitblit.Constants.PermissionType;
|
40 | 42 | import com.gitblit.Constants.RegistrantType;
|
| 43 | +import com.gitblit.GitBlit; |
41 | 44 | import com.gitblit.models.RegistrantAccessPermission;
|
| 45 | +import com.gitblit.models.UserModel; |
42 | 46 | import com.gitblit.utils.DeepCopier;
|
43 | 47 | import com.gitblit.utils.StringUtils;
|
44 | 48 | import com.gitblit.wicket.WicketUtils;
|
@@ -96,11 +100,23 @@ public void populateItem(final Item<RegistrantAccessPermission> item) {
|
96 | 100 | WicketUtils.setCssStyle(label, "font-weight: bold;");
|
97 | 101 | item.add(label);
|
98 | 102 | }
|
| 103 | + } else if (RegistrantType.USER.equals(entry.registrantType)) { |
| 104 | + // user |
| 105 | + PersonIdent ident = new PersonIdent(entry.registrant, null); |
| 106 | + UserModel user = GitBlit.self().getUserModel(entry.registrant); |
| 107 | + if (user != null) { |
| 108 | + ident = new PersonIdent(user.getDisplayName(), user.emailAddress); |
| 109 | + } |
| 110 | + |
| 111 | + Fragment userFragment = new Fragment("registrant", "userRegistrant", RegistrantPermissionsPanel.this); |
| 112 | + userFragment.add(new GravatarImage("userAvatar", ident, 16, false)); |
| 113 | + userFragment.add(new Label("userName", entry.registrant)); |
| 114 | + item.add(userFragment); |
99 | 115 | } else {
|
100 |
| - // user or team |
101 |
| - Label label = new Label("registrant", entry.registrant); |
102 |
| - WicketUtils.setCssStyle(label, "font-weight: bold;"); |
103 |
| - item.add(label); |
| 116 | + // team |
| 117 | + Fragment teamFragment = new Fragment("registrant", "teamRegistrant", RegistrantPermissionsPanel.this); |
| 118 | + teamFragment.add(new Label("teamName", entry.registrant)); |
| 119 | + item.add(teamFragment); |
104 | 120 | }
|
105 | 121 | switch (entry.permissionType) {
|
106 | 122 | case OWNER:
|
|
0 commit comments