From 28980c3d6d989b900d02e3357473294561334e4a Mon Sep 17 00:00:00 2001 From: Joel Johnson <joel.johnson@issinc.com> Date: Mon, 29 Jun 2015 12:19:07 -0400 Subject: [PATCH] use JEE 3.0 to allow cookie session tracking --- src/main/java/com/gitblit/wicket/pages/BlamePage.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/BlamePage.java b/src/main/java/com/gitblit/wicket/pages/BlamePage.java index ef023b7..e45bbbc 100644 --- a/src/main/java/com/gitblit/wicket/pages/BlamePage.java +++ b/src/main/java/com/gitblit/wicket/pages/BlamePage.java @@ -35,7 +35,6 @@ import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; -import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.revwalk.RevCommit; @@ -103,8 +102,6 @@ WicketUtils.newObjectParameter(repositoryName, objectId))); // blame page links - add(new BookmarkablePageLink<Void>("headLink", BlamePage.class, - WicketUtils.newPathParameter(repositoryName, Constants.HEAD, blobPath))); add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); @@ -147,6 +144,9 @@ } if (pathModel == null) { + final String notFound = MessageFormat.format("Blame page failed to find {0} in {1} @ {2}", + blobPath, repositoryName, objectId); + logger.error(notFound); add(new Label("annotation").setVisible(false)); add(new Label("missingBlob", missingBlob(blobPath, commit)).setEscapeModelStrings(false)); return; @@ -154,10 +154,11 @@ add(new Label("missingBlob").setVisible(false)); + final int tabLength = app().settings().getInteger(Keys.web.tabLength, 4); List<AnnotatedLine> lines = DiffUtils.blame(getRepository(), blobPath, objectId); final Map<?, String> colorMap = initializeColors(activeBlameType, lines); ListDataProvider<AnnotatedLine> blameDp = new ListDataProvider<AnnotatedLine>(lines); - DataView<AnnotatedLine> blameView = new DataView<AnnotatedLine>("blameView", blameDp) { + DataView<AnnotatedLine> blameView = new DataView<AnnotatedLine>("annotation", blameDp) { private static final long serialVersionUID = 1L; private String lastCommitId = ""; private boolean showInitials = true; @@ -212,7 +213,7 @@ color = colorMap.get(entry.commitId); break; } - Component data = new Label("data", StringUtils.escapeForHtml(entry.data, true)).setEscapeModelStrings(false); + Component data = new Label("data", StringUtils.escapeForHtml(entry.data, true, tabLength)).setEscapeModelStrings(false); data.add(new SimpleAttributeModifier("style", "background-color: " + color + ";")); item.add(data); } @@ -235,6 +236,11 @@ } @Override + protected boolean isCommitPage() { + return true; + } + + @Override protected Class<? extends BasePage> getRepoNavPageClass() { return TreePage.class; } -- Gitblit v1.9.1