Support relative links in commitdiff page and polish css
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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 |
| | |
| | | border-bottom: 0;
|
| | | border-radius: 3px 3px 0 0;
|
| | | font-weight: bold;
|
| | | font-family: Helvetica,arial,freesans,clean,sans-serif;
|
| | | }
|
| | |
|
| | | div.diffHeader {
|
| | | /* CSS trick to workaround #link topOfWindow offset problem */
|
| | | border-top: 65px solid transparent;
|
| | | margin-top: -65px;
|
| | | -webkit-background-clip: padding-box;
|
| | | -moz-background-clip: padding;
|
| | | background-clip: padding-box;
|
| | | }
|
| | |
|
| | | div.commitHeader {
|
| | |
| | | font-family: inherit;
|
| | | }
|
| | |
|
| | | div.diff table {
|
| | | border: 1px solid #ddd;
|
| | | }
|
| | |
|
| | | span.diff.add {
|
| | | color: #008800;
|
| | | font-family: inherit;
|