params = WicketUtils.newRepositoryParameter(repositoryName);
}
Map<String, PageRegistration> pages = new LinkedHashMap<String, PageRegistration>();
Repository r = getRepository();
RepositoryModel model = getRepositoryModel();
// standard links
if (RefLogUtils.getRefLogBranch(r) == null) {
pages.put("summary", new PageRegistration("gb.summary", SummaryPage.class, params));
} else {
pages.put("summary", new PageRegistration("gb.summary", SummaryPage.class, params));
// pages.put("overview", new PageRegistration("gb.overview", OverviewPage.class, params));
pages.put("reflog", new PageRegistration("gb.reflog", ReflogPage.class, params));
}
pages.put("commits", new PageRegistration("gb.commits", LogPage.class, params));
pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params));
if (app().tickets().isReady() && (app().tickets().isAcceptingNewTickets(getRepositoryModel()) || app().tickets().hasTickets(getRepositoryModel()))) {
PageParameters tParams = new PageParameters(params);
for (String state : TicketsPage.openStatii) {
tParams.add(Lucene.status.name(), state);
}
pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, tParams));
}
pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params, true));
if (app().settings().getBoolean(Keys.web.allowForking, true)) {
pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params, true));
}
pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params, true));
// conditional links
// per-repository extra page links
if (JGitUtils.getPagesBranch(r) != null) {
OtherPageLink pagesLink = new OtherPageLink("gb.pages", PagesServlet.asLink(
getRequest().getRelativePathPrefixToContextRoot(), repositoryName, null), true);
pages.put("pages", pagesLink);
}
// Conditionally add edit link
showAdmin = false;
if (app().settings().getBoolean(Keys.web.authenticateAdminPages, true)) {
boolean allowAdmin = app().settings().getBoolean(Keys.web.allowAdministration, false);
showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();
} else {
showAdmin = app().settings().getBoolean(Keys.web.allowAdministration, false);
}
isOwner = GitBlitWebSession.get().isLoggedIn()
&& (model.isOwner(GitBlitWebSession.get()
.getUsername()));
return pages;
}