diff options
author | James Moger <james.moger@gitblit.com> | 2013-05-23 23:10:43 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-05-23 23:10:43 -0400 |
commit | 5c0605d5665196b3726cc64bfd80b45ec963417b (patch) | |
tree | 968a263bb553704252901b17c50bd2967ab65554 /src/main/java | |
parent | 80d532afc6de7df0cf817ee77d08c6eeb257a9c0 (diff) | |
download | gitblit-5c0605d5665196b3726cc64bfd80b45ec963417b.tar.gz gitblit-5c0605d5665196b3726cc64bfd80b45ec963417b.zip |
Support relative links in commitdiff page and polish css
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java | 4 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java | 12 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java index 2966aa8a..f871e778 100644 --- a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java +++ b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java @@ -20,6 +20,7 @@ import static org.eclipse.jgit.lib.Constants.encode; import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.text.MessageFormat;
import org.eclipse.jgit.diff.RawText;
import org.eclipse.jgit.util.RawParseUtils;
@@ -150,7 +151,8 @@ public class GitBlitDiffFormatter extends GitWebDiffFormatter { sb.append("</tbody></table></div>\n");
inFile = false;
}
- sb.append("<div class='header'>").append(line).append("</div>");
+
+ sb.append(MessageFormat.format("<div class='header'><div class=\"diffHeader\" id=\"{0}\"><i class=\"icon-file\"></i> ", line)).append(line).append("</div></div>");
sb.append("<div class=\"diff\">");
sb.append("<table><tbody>");
inFile = true;
diff --git a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java index eb1d5d82..f9c4e68b 100644 --- a/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java +++ b/src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java @@ -136,15 +136,11 @@ public class CommitDiffPage extends RepositoryPage { submodulePath = submodule.gitblitPath; hasSubmodule = submodule.hasSubmodule; - item.add(new LinkPanel("pathName", "list", entry.path + " @ " + - getShortObjectId(submoduleId), TreePage.class, - WicketUtils - .newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule)); + // add relative link + item.add(new LinkPanel("pathName", "list", entry.path + " @ " + getShortObjectId(submoduleId), "#" + entry.path)); } else { - // blob - item.add(new LinkPanel("pathName", "list", entry.path, BlobPage.class, - WicketUtils - .newPathParameter(repositoryName, entry.commitId, entry.path))); + // add relative link + item.add(new LinkPanel("pathName", "list", entry.path, "#" + entry.path)); } // quick links |