From 716745e2dd9b3925b1229433e7072580206f731e Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Wed, 08 Jun 2011 17:38:11 -0400 Subject: [PATCH] Stubbed out Blame. Added Github banner to site. Documentation. --- docs/page_header.html | 3 src/com/gitblit/wicket/pages/BlamePage.html | 39 +++++++ distrib/installService.cmd | 2 src/com/gitblit/wicket/pages/TreePage.java | 5 src/com/gitblit/wicket/pages/BlamePage.java | 97 +++++++++++++++++++ src/com/gitblit/wicket/pages/BlobDiffPage.java | 3 src/com/gitblit/wicket/resources/gitblit.css | 2 docs/01_faq.mkd | 17 ++- src/com/gitblit/wicket/pages/CommitPage.java | 22 ++- README.MKD | 2 src/com/gitblit/wicket/pages/BlobPage.html | 2 src/com/gitblit/wicket/pages/BlobDiffPage.html | 2 distrib/users.properties | 2 src/com/gitblit/wicket/pages/CommitDiffPage.java | 5 src/com/gitblit/wicket/GitBlitWebApp.java | 4 docs/00_index.mkd | 37 +++++- src/com/gitblit/wicket/pages/BlobPage.java | 6 distrib/installService64.cmd | 2 src/com/gitblit/wicket/pages/SummaryPage.java | 3 19 files changed, 214 insertions(+), 41 deletions(-) diff --git a/README.MKD b/README.MKD index 2a94730..bb272b3 100644 --- a/README.MKD +++ b/README.MKD @@ -8,7 +8,7 @@ ------- Gitblit is distributed under the terms of the Apache Software Foundation -license, version 2.0. The text is included in the file LICENSE in the root +license, version 2.0. The text of the license is included in the file LICENSE in the root of the project. Java/Application server requirements diff --git a/distrib/installService.cmd b/distrib/installService.cmd index 0d181e1..093c877 100644 --- a/distrib/installService.cmd +++ b/distrib/installService.cmd @@ -1,2 +1,2 @@ -set JVM=C:\Program Files\Java\JVM1.6.0_21 +set JVM=C:\Program Files\Java\jdk1.6.0_26 JavaService.exe -install gitblit "%JVM%\jre\bin\server\jvm.dll" -Xmx1024M -Djava.class.path=%CD%\gitblit.jar;"%JVM%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD% \ No newline at end of file diff --git a/distrib/installService64.cmd b/distrib/installService64.cmd index 10a3444..42d2ca5 100644 --- a/distrib/installService64.cmd +++ b/distrib/installService64.cmd @@ -1,2 +1,2 @@ -set JVM=C:\Program Files\Java\JVM1.6.0_21 +set JVM=C:\Program Files\Java\jdk1.6.0_26 JavaService64.exe -install gitblit "%JVM%\jre\bin\server\jvm.dll" -Djava.class.path=%CD%\gitblit.jar;"%JVM%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD% \ No newline at end of file diff --git a/distrib/users.properties b/distrib/users.properties index f3e5075..56142df 100644 --- a/distrib/users.properties +++ b/distrib/users.properties @@ -1,3 +1,3 @@ ## Git:Blit realm file format: username=password,\#permission,repository1,repository2... -#Sat Jun 04 14:21:04 EDT 2011 +#Tue Jun 07 20:57:42 EDT 2011 admin=admin,\#admin diff --git a/docs/00_index.mkd b/docs/00_index.mkd index d133163..2f15b38 100644 --- a/docs/00_index.mkd +++ b/docs/00_index.mkd @@ -31,9 +31,11 @@ - Repository Owners may edit repositories through the web UI - Automatically generates a self-signed certificate for https communications - Git-notes support -- Branch-selectable metrics +- Branch metrics +- Blame annotations view - Dates can optionally be displayed using the browser's reported timezone - Author and Committer email address display can be controlled +- Search commit messages, authors, and committers - Dynamic zip downloads feature - Markdown view support - Syntax highlighting @@ -48,27 +50,37 @@ </ul> ### Limitations +- [%JGIT%][jgit] does not [garbage collect or repack](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) - HTTP/HTTPS are the only supported protocols - Access controls are not path-based, they are repository-based - Only Administrators can create, rename or delete repositories - Gitblit is an integrated, full-stack solution. There is no WAR build at this time. +### Caveats +- I don't know everything there is to know about [Git][git] nor [JGit][jgit]. +- Gitblit may eat your data. Use at your own risk. +- Gitblit may have security holes. Patches welcome. :) + ### Todo List - Code documentation - Unit testing -- Blame +- Finish Blame (waiting for JGit 1.0.0 release) - Clone remote repository ### Idea List -- Ticgit activity/timeline -- Ticgit query feature with paging support -- Ticgit ticket change history -- View images on Blob page -- View other binary files on Blob page +- Consider [Apache Shiro](http://shiro.apache.org) for authentication +- Stronger Ticgit read-only integration + - activity/timeline + - query feature with paging support + - change history +- Ticgit write integration +- Blob page improvements + - view images + - view other binary files (pdf, doc, etc) - Markdown editing feature ### License -Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) +Gitblit is distributed under the terms of the [Apache Software Foundation license, version 2.0][apachelicense] ### Inspirations - [Gitweb](http://www.git-scm.com) @@ -123,6 +135,13 @@ - If running on Linux you may have to change the served port(s) to > 1024 unless you are developing as the root user. 6. Execute the *com.gitblit.Launcher* class to start Gitblit. + +## Contributing +Patches welcome in any form. + +Contributions must be your own original work and must licensed under the [Apache License, Version 2.0][apachelicense], the same license used by Gitblit. + [jgit]: http://eclipse.org/jgit "Eclipse JGit Site" [git]: http://git-scm.com "Official Git Site" -[gitbltsrc]: http://somewhere.com "gitblit git repository" \ No newline at end of file +[gitbltsrc]: http://somewhere.com "gitblit git repository" +[apachelicense]: http://www.apache.org/licenses/LICENSE-2.0 "Apache License, Version 2.0" \ No newline at end of file diff --git a/docs/01_faq.mkd b/docs/01_faq.mkd index a80e4e2..e6760ce 100644 --- a/docs/01_faq.mkd +++ b/docs/01_faq.mkd @@ -36,9 +36,8 @@ As a Java developer I prefer that as much of my tooling as possible is Java.<br/> Originally, I was going to use [Mercurial](http://mercurial.selenic.com) but... -- MercurialEclipse [shells to Python and captures System.in](http://mercurial.808500.n3.nabble.com/Hg4J-Mercurial-pure-Java-library-tp2693090p2694555.html)<br/> +- MercurialEclipse [shells to Python, writes to System.out, and captures System.in](http://mercurial.808500.n3.nabble.com/Hg4J-Mercurial-pure-Java-library-tp2693090p2694555.html)<br/> Parsing command-line output is fragile and suboptimal.<br/>Unfortunately this is necessary because Mercurial is an application, not a library. -- Mercurial seems to [frown](http://mercurial.808500.n3.nabble.com/Hg4J-Mercurial-pure-Java-library-tp2693090p2695051.html) on the fledgling [Hg4j][hg4j] (pure Java Mercurial) project. - Mercurial HTTP/HTTPS needs to run as CGI through Apache/IIS/etc, as mod_python through Apache, or served with a built-in http server.<br/> This requires setup and maintenance of multiple, mixed 3rd party components. @@ -47,6 +46,13 @@ ### Do I need real Git? No. Gitblit is based on [JGit][jgit] which is a pure Java implementation of the [Git version control system][git].<br/> Everything you need for Gitblit is either in the zip distribution file or automatically downloaded on execution. + +### What about periodic Git garbage collection (git-gc)? +Good question. I'm not sure. + +Git repositories grow and grow and periodically need to be repacked every once in a while. Git calls this process [garbage collection](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) (which is not to be confused with [garbage collection](http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)).) + +[JGit's][jgit] documentation is sparse and its unclear whether or not JGit performs this function. ### Can I run Gitblit in conjunction with my existing Git tooling? Yes. You can configure Gitblit to only be a repository viewer. @@ -72,7 +78,7 @@ ### Why doesn't Gitblit support SSH? Gitblit could integrate [Apache Mina][mina] to provide SSH access. However, doing so violates Gitblit's first design principle: [KISS](http://en.wikipedia.org/wiki/KISS_principle).<br/> -SSH support requires creating, exchanging, and managing SSH keys. While this is possible, JGit's SmartHTTP implementation is a simpler and universal transport mechanism. +SSH support requires creating, exchanging, and managing SSH keys (arguably not more complicated than managing users). While this is possible, JGit's SmartHTTP implementation is a simpler and universal transport mechanism. You might consider running [Gerrit](http://gerrit.googlecode.org) which does integrate [Apache Mina][mina] and supports SSH or you might consider serving [Git][git] on Linux which would offer real SSH support and also allow use of [many other compelling Git solutions](https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools). @@ -86,8 +92,9 @@ Alternatively, you could enable the search type dropdown list in your `gitblit.properties` file. -### I see a disabled "blame" link. How do I enable it? -Currently blame is not implemented. Those links are placeholders to remind me where Gitweb offers blame. +### Can Gitblit be translated? + +Yes. Most messages are localized to a standard Java properties file. [bitblt]: http://en.wikipedia.org/wiki/Bit_blit "Wikipedia Bitblt" [jgit]: http://eclipse.org/jgit "Eclipse JGit Site" diff --git a/docs/page_header.html b/docs/page_header.html index 4a2128e..7b8f63d 100644 --- a/docs/page_header.html +++ b/docs/page_header.html @@ -28,7 +28,8 @@ <script type="text/javascript" src="prettify/prettify.js"></script> <link href="prettify/prettify.css" type="text/css" rel="stylesheet" /> </head> - <body onload="prettyPrint()"> + <body style="width:900px" onload="prettyPrint()"> + <a href="http://github.com/gitblit"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub"></a> <div class="page_header"> <a title="gitblit homepage" href="http://gitblit.com/"> <img src="./gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/> diff --git a/src/com/gitblit/wicket/GitBlitWebApp.java b/src/com/gitblit/wicket/GitBlitWebApp.java index 61b51e8..daf1084 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.java +++ b/src/com/gitblit/wicket/GitBlitWebApp.java @@ -26,6 +26,7 @@ import com.gitblit.GitBlit; import com.gitblit.Keys; +import com.gitblit.wicket.pages.BlamePage; import com.gitblit.wicket.pages.BlobDiffPage; import com.gitblit.wicket.pages.BlobPage; import com.gitblit.wicket.pages.BranchesPage; @@ -37,11 +38,11 @@ import com.gitblit.wicket.pages.LoginPage; import com.gitblit.wicket.pages.LogoutPage; import com.gitblit.wicket.pages.MarkdownPage; +import com.gitblit.wicket.pages.MetricsPage; import com.gitblit.wicket.pages.PatchPage; import com.gitblit.wicket.pages.RawPage; import com.gitblit.wicket.pages.RepositoriesPage; import com.gitblit.wicket.pages.SearchPage; -import com.gitblit.wicket.pages.MetricsPage; import com.gitblit.wicket.pages.SummaryPage; import com.gitblit.wicket.pages.TagPage; import com.gitblit.wicket.pages.TagsPage; @@ -85,6 +86,7 @@ mount("/history", HistoryPage.class, "r", "h", "f"); mount("/search", SearchPage.class); mount("/metrics", MetricsPage.class, "r"); + mount("/blame", BlamePage.class, "r", "h", "f"); // setup ticket urls mount("/tickets", TicketsPage.class, "r"); diff --git a/src/com/gitblit/wicket/pages/BlamePage.html b/src/com/gitblit/wicket/pages/BlamePage.html new file mode 100644 index 0000000..27ed734 --- /dev/null +++ b/src/com/gitblit/wicket/pages/BlamePage.html @@ -0,0 +1,39 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" + xml:lang="en" + lang="en"> + +<body> +<wicket:extend> + + <!-- blame nav links --> + <div class="page_nav2"> + <a wicket:id="blobLink"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a> | <a wicket:id="commitLink"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="commitDiffLink"><wicket:message key="gb.commitdiff"></wicket:message></a> + </div> + + <!-- commit header --> + <div wicket:id="commitHeader">[commit header]</div> + + <!-- breadcrumbs --> + <div wicket:id="breadcrumbs">[breadcrumbs]</div> + + <!-- blame content --> + <table> + <tbody> + <tr> + <th>Commit</th> + <th>Line</th> + <th>Data</th> + </tr> + <tr wicket:id="annotation"> + <td><span wicket:id="commit"></span></td> + <td><span wicket:id="line"></span></td> + <td><span wicket:id="data"></span></td> + </tr> + </tbody> + </table> + +</wicket:extend> +</body> +</html> \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/BlamePage.java b/src/com/gitblit/wicket/pages/BlamePage.java new file mode 100644 index 0000000..dc6aa1f --- /dev/null +++ b/src/com/gitblit/wicket/pages/BlamePage.java @@ -0,0 +1,97 @@ +/* + * Copyright 2011 gitblit.com. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gitblit.wicket.pages; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; + +import org.apache.wicket.PageParameters; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +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.revwalk.RevCommit; + +import com.gitblit.wicket.WicketUtils; +import com.gitblit.wicket.panels.CommitHeaderPanel; +import com.gitblit.wicket.panels.LinkPanel; +import com.gitblit.wicket.panels.PathBreadcrumbsPanel; + +public class BlamePage extends RepositoryPage { + + public BlamePage(PageParameters params) { + super(params); + + final String blobPath = WicketUtils.getPath(params); + + RevCommit commit = getCommit(); + + add(new BookmarkablePageLink<Void>("blobLink", BlobPage.class, + WicketUtils.newPathParameter(repositoryName, objectId, + blobPath))); + add(new BookmarkablePageLink<Void>("commitLink", CommitPage.class, + WicketUtils.newObjectParameter(repositoryName, objectId))); + add(new BookmarkablePageLink<Void>("commitDiffLink", CommitDiffPage.class, + 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))); + + add(new CommitHeaderPanel("commitHeader", repositoryName, commit)); + + add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId)); + + List<BlameLine> blame = Arrays.asList(new BlameLine("HEAD", "1", "Under Construction")); + ListDataProvider<BlameLine> blameDp = new ListDataProvider<BlameLine>(blame); + DataView<BlameLine> blameView = new DataView<BlameLine>("annotation", blameDp) { + private static final long serialVersionUID = 1L; + + public void populateItem(final Item<BlameLine> item) { + BlameLine entry = item.getModelObject(); + item.add(new LinkPanel("commit", "list", entry.objectId, CommitPage.class, + newCommitParameter(entry.objectId))); + item.add(new Label("line", entry.line)); + item.add(new Label("data", entry.data)); + } + }; + add(blameView); + } + + @Override + protected String getPageName() { + return getString("gb.blame"); + } + + private class BlameLine implements Serializable { + + private static final long serialVersionUID = 1L; + + final String objectId; + final String line; + final String data; + BlameLine(String objectId, String line, String data) { + this.objectId = objectId; + this.line = line; + this.data = data; + } + } +} diff --git a/src/com/gitblit/wicket/pages/BlobDiffPage.html b/src/com/gitblit/wicket/pages/BlobDiffPage.html index 4818aa8..c633642 100644 --- a/src/com/gitblit/wicket/pages/BlobDiffPage.html +++ b/src/com/gitblit/wicket/pages/BlobDiffPage.html @@ -9,7 +9,7 @@ <!-- blob nav links --> <div class="page_nav2"> - <span wicket:id="blameLink">[blame link]</span> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="patchLink"><wicket:message key="gb.patch"></wicket:message></a> | <a wicket:id="commitLink"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="commitDiffLink"><wicket:message key="gb.commitdiff"></wicket:message></a> + <a wicket:id="blameLink"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="patchLink"><wicket:message key="gb.patch"></wicket:message></a> | <a wicket:id="commitLink"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="commitDiffLink"><wicket:message key="gb.commitdiff"></wicket:message></a> </div> <!-- commit header --> diff --git a/src/com/gitblit/wicket/pages/BlobDiffPage.java b/src/com/gitblit/wicket/pages/BlobDiffPage.java index a8f8b3c..d86d2e6 100644 --- a/src/com/gitblit/wicket/pages/BlobDiffPage.java +++ b/src/com/gitblit/wicket/pages/BlobDiffPage.java @@ -66,7 +66,8 @@ WicketUtils.newObjectParameter(repositoryName, objectId))); // diff page links - add(new Label("blameLink", getString("gb.blame"))); + add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); diff --git a/src/com/gitblit/wicket/pages/BlobPage.html b/src/com/gitblit/wicket/pages/BlobPage.html index 5237443..3c85141 100644 --- a/src/com/gitblit/wicket/pages/BlobPage.html +++ b/src/com/gitblit/wicket/pages/BlobPage.html @@ -18,7 +18,7 @@ <!-- blob nav links --> <div class="page_nav2"> - <span wicket:id="blameLink">[blame link]</span> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a> + <a wicket:id="blameLink"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="headLink"><wicket:message key="gb.head"></wicket:message></a> </div> <!-- commit header --> diff --git a/src/com/gitblit/wicket/pages/BlobPage.java b/src/com/gitblit/wicket/pages/BlobPage.java index 3c5c8e0..47c8ca8 100644 --- a/src/com/gitblit/wicket/pages/BlobPage.java +++ b/src/com/gitblit/wicket/pages/BlobPage.java @@ -45,7 +45,8 @@ if (StringUtils.isEmpty(blobPath)) { // blob by objectid - add(new Label("blameLink", getString("gb.blame")).setEnabled(false)); + add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, objectId, blobPath)).setEnabled(false)); add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class).setEnabled(false)); add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); @@ -74,7 +75,8 @@ RevCommit commit = JGitUtils.getCommit(r, objectId); // blob page links - add(new Label("blameLink", getString("gb.blame"))); + add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, blobPath))); add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, diff --git a/src/com/gitblit/wicket/pages/CommitDiffPage.java b/src/com/gitblit/wicket/pages/CommitDiffPage.java index 4815b2c..3abcf13 100644 --- a/src/com/gitblit/wicket/pages/CommitDiffPage.java +++ b/src/com/gitblit/wicket/pages/CommitDiffPage.java @@ -98,9 +98,10 @@ newPathParameter(entry.path))); item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, newPathParameter(entry.path))); - item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false)); + item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, + newPathParameter(entry.path))); item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, - newPathParameter(entry.path)).setEnabled(!entry.changeType.equals(ChangeType.ADD) && !entry.changeType.equals(ChangeType.DELETE))); + newPathParameter(entry.path)).setEnabled(!entry.changeType.equals(ChangeType.ADD))); WicketUtils.setAlternatingBackground(item, counter); counter++; diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java index 7b5fdbe..d9ff1b7 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.java +++ b/src/com/gitblit/wicket/pages/CommitPage.java @@ -125,15 +125,16 @@ public void populateItem(final Item<GitNote> item) { GitNote entry = item.getModelObject(); item.add(new RefsPanel("refName", repositoryName, Arrays.asList(entry.notesRef))); - item.add(createPersonPanel("authorName", entry.notesRef.getAuthorIdent(), SearchType.AUTHOR)); - item.add(WicketUtils.createTimestampLabel("authorDate", - entry.notesRef.getAuthorIdent().getWhen(), getTimeZone())); - item.add(new Label("noteContent", StringUtils.breakLinesForHtml(entry.content)).setEscapeModelStrings(false)); + item.add(createPersonPanel("authorName", entry.notesRef.getAuthorIdent(), + SearchType.AUTHOR)); + item.add(WicketUtils.createTimestampLabel("authorDate", entry.notesRef + .getAuthorIdent().getWhen(), getTimeZone())); + item.add(new Label("noteContent", StringUtils.breakLinesForHtml(entry.content)) + .setEscapeModelStrings(false)); } }; add(notesView.setVisible(notes.size() > 0)); - - + // changed paths list List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, c); add(new CommitLegendPanel("commitLegend", paths)); @@ -157,12 +158,15 @@ } item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, - newPathParameter(entry.path)).setEnabled(!entry.changeType.equals(ChangeType.ADD) && !entry.changeType.equals(ChangeType.DELETE))); + newPathParameter(entry.path)).setEnabled(!entry.changeType + .equals(ChangeType.ADD) && !entry.changeType.equals(ChangeType.DELETE))); item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, newPathParameter(entry.path))); - item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false)); + item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, + newPathParameter(entry.path))); item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, - newPathParameter(entry.path)).setEnabled(!entry.changeType.equals(ChangeType.ADD))); + newPathParameter(entry.path)).setEnabled(!entry.changeType + .equals(ChangeType.ADD))); WicketUtils.setAlternatingBackground(item, counter); counter++; diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 03b1b1c..37b0bcf 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -203,11 +203,10 @@ metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name }); provider.addAxis(dateAxis); - ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT); + ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT); commitAxis.setLabels(new String[] { "", String.valueOf((int) WicketUtils.maxValue(metrics)) }); provider.addAxis(commitAxis); - provider.setLineStyles(new LineStyle[] { new LineStyle(2, 4, 0), new LineStyle(0, 4, 1) }); provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5)); diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java index f796266..68eecf0 100644 --- a/src/com/gitblit/wicket/pages/TreePage.java +++ b/src/com/gitblit/wicket/pages/TreePage.java @@ -129,8 +129,9 @@ entry.path))); links.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils .newPathParameter(repositoryName, entry.commitId, entry.path))); - links.add(new BookmarkablePageLink<Void>("blame", BlobPage.class) - .setEnabled(false)); + links.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, + WicketUtils.newPathParameter(repositoryName, entry.commitId, + entry.path))); links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path))); diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css index a0ab10a..7c896df 100644 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ b/src/com/gitblit/wicket/resources/gitblit.css @@ -737,7 +737,7 @@ } span .otherRef { - background-color: #80ccdd; + background-color: #b0e0f0; border-color: #80aaaa; } -- Gitblit v1.9.1