import com.gitblit.models.Metric;\r
import com.gitblit.models.PathModel;\r
import com.gitblit.models.RepositoryModel;\r
+import com.gitblit.models.UserModel;\r
import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.JGitUtils;\r
import com.gitblit.utils.MarkdownUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.BranchesPanel;\r
+import com.gitblit.wicket.panels.LinkPanel;\r
import com.gitblit.wicket.panels.LogPanel;\r
import com.gitblit.wicket.panels.RepositoryUrlPanel;\r
import com.gitblit.wicket.panels.TagsPanel;\r
\r
// repository description\r
add(new Label("repositoryDescription", getRepositoryModel().description));\r
- add(new Label("repositoryOwner", getRepositoryModel().owner));\r
+ String owner = getRepositoryModel().owner;\r
+ if (StringUtils.isEmpty(owner)) {\r
+ add(new Label("repositoryOwner").setVisible(false));\r
+ } else {\r
+ UserModel ownerModel = GitBlit.self().getUserModel(owner);\r
+ if (ownerModel != null) {\r
+ add(new LinkPanel("repositoryOwner", null, ownerModel.getDisplayName(), UserPage.class, WicketUtils.newUsernameParameter(owner)));\r
+ } else {\r
+ add(new Label("repositoryOwner", owner));\r
+ }\r
+ }\r
\r
add(WicketUtils.createTimestampLabel("repositoryLastChange",\r
JGitUtils.getLastChange(r), getTimeZone(), getTimeUtils()));\r
\r
private static final long serialVersionUID = 1L;\r
\r
- public ProjectRepositoryPanel(String wicketId, Localizer localizer, Component owner,\r
+ public ProjectRepositoryPanel(String wicketId, Localizer localizer, Component parent,\r
final boolean isAdmin, final RepositoryModel entry,\r
final Map<AccessRestrictionType, String> accessRestrictions) {\r
super(wicketId);\r
swatch = new Label("repositorySwatch", " ").setEscapeModelStrings(false);\r
} else {\r
swatch = new Label("repositorySwatch", "!");\r
- WicketUtils.setHtmlTooltip(swatch, localizer.getString("gb.workingCopyWarning", owner));\r
+ WicketUtils.setHtmlTooltip(swatch, localizer.getString("gb.workingCopyWarning", parent));\r
}\r
WicketUtils.setCssBackground(swatch, entry.toString());\r
add(swatch);\r
add(new BookmarkablePageLink<Void>("docs", DocsPage.class, pp).setVisible(entry.useDocs));\r
\r
if (entry.isFrozen) {\r
- add(WicketUtils.newImage("frozenIcon", "cold_16x16.png", localizer.getString("gb.isFrozen", owner)));\r
+ add(WicketUtils.newImage("frozenIcon", "cold_16x16.png", localizer.getString("gb.isFrozen", parent)));\r
} else {\r
add(WicketUtils.newClearPixel("frozenIcon").setVisible(false));\r
}\r
\r
if (entry.isFederated) {\r
- add(WicketUtils.newImage("federatedIcon", "federated_16x16.png", localizer.getString("gb.isFederated", owner)));\r
+ add(WicketUtils.newImage("federatedIcon", "federated_16x16.png", localizer.getString("gb.isFederated", parent)));\r
} else {\r
add(WicketUtils.newClearPixel("federatedIcon").setVisible(false));\r
}\r
add(WicketUtils.newBlankImage("accessRestrictionIcon"));\r
}\r
\r
- add(new Label("repositoryOwner", StringUtils.isEmpty(entry.owner) ? "" : (entry.owner + " ("\r
- + localizer.getString("gb.owner", owner) + ")")));\r
+ if (StringUtils.isEmpty(entry.owner)) {\r
+ add(new Label("repositoryOwner").setVisible(false));\r
+ } else {\r
+ UserModel ownerModel = GitBlit.self().getUserModel(entry.owner);\r
+ String owner = entry.owner;\r
+ if (ownerModel != null) {\r
+ owner = ownerModel.getDisplayName();\r
+ }\r
+ add(new Label("repositoryOwner", owner + " (" +\r
+ localizer.getString("gb.owner", parent) + ")"));\r
+ }\r
\r
UserModel user = GitBlitWebSession.get().getUser();\r
Fragment repositoryLinks;\r
}\r
};\r
deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(\r
- localizer.getString("gb.deleteRepository", owner), entry)));\r
+ localizer.getString("gb.deleteRepository", parent), entry)));\r
repositoryLinks.add(deleteLink);\r
}\r
} else {\r
add(new Label("repositorySize", entry.size).setVisible(showSize));\r
} else {\r
// New repository\r
- add(new Label("repositorySize", localizer.getString("gb.empty", owner)).setEscapeModelStrings(false));\r
+ add(new Label("repositorySize", localizer.getString("gb.empty", parent)).setEscapeModelStrings(false));\r
}\r
\r
add(new ExternalLink("syndication", SyndicationServlet.asLink("", entry.name, null, 0)));\r