| | |
| | | }
|
| | | pages.put("commits", new PageRegistration("gb.commits", LogPage.class, params));
|
| | | pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params));
|
| | | pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params));
|
| | | pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params, true));
|
| | | if (GitBlit.getBoolean(Keys.web.allowForking, true)) {
|
| | | pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params));
|
| | | pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params, true));
|
| | | }
|
| | |
|
| | | // conditional links
|
| | | // per-repository extra page links
|
| | | if (model.useTickets && TicgitUtils.getTicketsBranch(r) != null) {
|
| | | pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, params));
|
| | | pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, params, true));
|
| | | }
|
| | | if (model.showReadme || model.useDocs) {
|
| | | pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params));
|
| | | pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params, true));
|
| | | }
|
| | | if (JGitUtils.getPagesBranch(r) != null) {
|
| | | OtherPageLink pagesLink = new OtherPageLink("gb.pages", PagesServlet.asLink(
|
| | | getRequest().getRelativePathPrefixToContextRoot(), repositoryName, null));
|
| | | getRequest().getRelativePathPrefixToContextRoot(), repositoryName, null), true);
|
| | | pages.put("pages", pagesLink);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // (un)star link allows a user to star someone else's repository
|
| | | if (user.isAuthenticated && !model.isOwner(user.username) && !model.isUsersPersonalRepository(user.username)) {
|
| | | // (un)star link allows a user to star a repository
|
| | | if (user.isAuthenticated) {
|
| | | PageParameters starParams = DeepCopier.copy(getPageParameters());
|
| | | starParams.put(PARAM_STAR, !user.getPreferences().isStarredRepository(model.name));
|
| | | String toggleStarUrl = getRequestCycle().urlFor(getClass(), starParams).toString();
|
| | |
| | | add(new Label("unstarLink").setVisible(false));
|
| | | }
|
| | | } else {
|
| | | // anonymous user or the repository owner is browsing the repository
|
| | | // anonymous user
|
| | | add(new Label("starLink").setVisible(false));
|
| | | add(new Label("unstarLink").setVisible(false));
|
| | | }
|