summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-06-08 10:30:39 -0400
committerJames Moger <james.moger@gitblit.com>2014-06-13 08:00:48 -0400
commit6651a8e96bdc51b0c558b88e1c77fcfbed1837da (patch)
treeb2d89a6dd77868783485af61636c65edf32b1861 /src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
parent2bfea381bbcea934f7e20f8c00db86e990c2fc93 (diff)
downloadgitblit-ticket/75.tar.gz
gitblit-ticket/75.zip
Move repository ownership to the UserModel and prepare for project ownershipticket/75
Diffstat (limited to 'src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java b/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
index 8630d201..a30faff1 100644
--- a/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
@@ -15,6 +15,7 @@
*/
package com.gitblit.wicket.panels;
+import java.util.List;
import java.util.Map;
import org.apache.wicket.Component;
@@ -27,6 +28,7 @@ import org.apache.wicket.markup.html.panel.Fragment;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Keys;
+import com.gitblit.models.Owner;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.servlet.SyndicationServlet;
@@ -64,7 +66,7 @@ public class ProjectRepositoryPanel extends BasePanel {
swatch.setVisible(showSwatch);
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);
- add(new LinkPanel("repositoryName", "list", StringUtils.getRelativePath(entry.projectPath,
+ add(new LinkPanel("repositoryName", "list", StringUtils.getRelativePath(entry.getProject(),
StringUtils.stripDotGit(entry.name)), SummaryPage.class, pp));
add(new Label("repositoryDescription", entry.description).setVisible(!StringUtils
.isEmpty(entry.description)));
@@ -102,23 +104,17 @@ public class ProjectRepositoryPanel extends BasePanel {
add(WicketUtils.newClearPixel("federatedIcon").setVisible(false));
}
- if (ArrayUtils.isEmpty(entry.owners)) {
+ List<Owner> owners = app().users().getOwners(entry);
+ if (ArrayUtils.isEmpty(owners)) {
add(new Label("repositoryOwner").setVisible(false));
} else {
- String owner = "";
- for (String username : entry.owners) {
- UserModel ownerModel = app().users().getUserModel(username);
-
- if (ownerModel != null) {
- owner = ownerModel.getDisplayName();
- }
- }
- if (entry.owners.size() > 1) {
+ String owner = owners.get(0).getDisplayName();
+ if (owners.size() > 1) {
owner += ", ...";
}
Label ownerLabel = (new Label("repositoryOwner", owner + " (" +
localizer.getString("gb.owner", parent) + ")"));
- WicketUtils.setHtmlTooltip(ownerLabel, ArrayUtils.toString(entry.owners));
+ WicketUtils.setHtmlTooltip(ownerLabel, ArrayUtils.toString(owners));
add(ownerLabel);
}