James Moger
2015-11-19 e41e8f8c3bc9f5edab1d271464364f95620ece8c
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;
   }