<!-- full message -->\r
<div wicket:id="fullMessage">[commit message]</div>\r
\r
+ <!-- git notes -->\r
+ <table class="gitnotes">\r
+ <tr wicket:id="notes">\r
+ <td class="info">\r
+ <table>\r
+ <tr><td><span wicket:id="refName"></span></td></tr>\r
+ <tr><td><span class="sha1" wicket:id="authorName"></span></td></tr>\r
+ <tr><td><span class="sha1" wicket:id="authorDate"></span></td></tr>\r
+ </table>\r
+ <!-- Note Author Gravatar -->\r
+ <span style="vertical-align: top;" wicket:id="noteAuthorAvatar" /> \r
+ </td>\r
+ <td class="message"><span class="sha1" wicket:id="noteContent"></span></td>\r
+ </tr>\r
+ </table>\r
+ \r
<!-- commit legend -->\r
<div class="hidden-phone" style="text-align:right;" wicket:id="commitLegend"></div>\r
\r
\r
<!-- diff content -->\r
<pre style="padding-top:10px;" wicket:id="diffText">[diff text]</pre>\r
+\r
+ <wicket:fragment wicket:id="fullPersonIdent">\r
+ <span wicket:id="personName"></span><span wicket:id="personAddress"></span>\r
+ </wicket:fragment>\r
+ \r
+ <wicket:fragment wicket:id="partialPersonIdent">\r
+ <span wicket:id="personName"></span>\r
+ </wicket:fragment>\r
\r
</wicket:extend>\r
</body>\r
package com.gitblit.wicket.pages;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.Constants;
import com.gitblit.GitBlit;
import com.gitblit.models.PathModel.PathChangeModel;
+import com.gitblit.models.GitNote;
import com.gitblit.models.SubmoduleModel;
import com.gitblit.utils.DiffUtils;
import com.gitblit.utils.DiffUtils.DiffOutputType;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.CommitHeaderPanel;
import com.gitblit.wicket.panels.CommitLegendPanel;
+import com.gitblit.wicket.panels.GravatarImage;
import com.gitblit.wicket.panels.LinkPanel;
+import com.gitblit.wicket.panels.RefsPanel;
@CacheControl(LastModified.BOOT)
public class CommitDiffPage extends RepositoryPage {
addFullText("fullMessage", commit.getFullMessage());
+ // git notes
+ List<GitNote> notes = JGitUtils.getNotesOnCommit(r, commit);
+ ListDataProvider<GitNote> notesDp = new ListDataProvider<GitNote>(notes);
+ DataView<GitNote> notesView = new DataView<GitNote>("notes", notesDp) {
+ private static final long serialVersionUID = 1L;
+
+ 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(),
+ Constants.SearchType.AUTHOR));
+ item.add(new GravatarImage("noteAuthorAvatar", entry.notesRef.getAuthorIdent()));
+ item.add(WicketUtils.createTimestampLabel("authorDate", entry.notesRef
+ .getAuthorIdent().getWhen(), getTimeZone(), getTimeUtils()));
+ item.add(new Label("noteContent", GitBlit.self().processPlainCommitMessage(repositoryName,
+ entry.content)).setEscapeModelStrings(false));
+ }
+ };
+ add(notesView.setVisible(notes.size() > 0));
+
// changed paths list
List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);