From 06116dd5f166ec2fff0531d21d6a291c9018703c Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 17 Jun 2013 16:00:17 -0400 Subject: [PATCH] Minor tweaks to SalesForce user service --- src/main/java/com/gitblit/wicket/pages/RepositoryPage.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java index 918127b..a15dd91 100644 --- a/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/RepositoryPage.java @@ -196,22 +196,22 @@ } 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); } @@ -286,8 +286,8 @@ } } - // (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(); @@ -301,7 +301,7 @@ 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)); } @@ -390,7 +390,8 @@ RevCommit commit = JGitUtils.getCommit(r, objectId); if (commit == null) { error(MessageFormat.format(getString("gb.failedToFindCommit"), - objectId, repositoryName, getPageName()), true); + objectId, repositoryName, getPageName()), null, LogPage.class, + WicketUtils.newRepositoryParameter(repositoryName)); } getSubmodules(commit); return commit; -- Gitblit v1.9.1