| | |
| | | import com.gitblit.models.PathModel.PathChangeModel;
|
| | | import com.gitblit.models.SubmoduleModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.CommitHeaderPanel;
|
| | | import com.gitblit.wicket.panels.CommitLegendPanel;
|
| | | import com.gitblit.wicket.panels.CompressedDownloadsPanel;
|
| | | import com.gitblit.wicket.panels.DiffStatPanel;
|
| | | import com.gitblit.wicket.panels.GravatarImage;
|
| | | import com.gitblit.wicket.panels.LinkPanel;
|
| | | import com.gitblit.wicket.panels.RefsPanel;
|
| | |
|
| | | @CacheControl(LastModified.BOOT)
|
| | | public class CommitPage extends RepositoryPage {
|
| | |
|
| | | public CommitPage(PageParameters params) {
|
| | |
| | | };
|
| | | add(parentsView);
|
| | |
|
| | | addFullText("fullMessage", c.getFullMessage(), true);
|
| | | addFullText("fullMessage", c.getFullMessage());
|
| | |
|
| | | // git notes
|
| | | List<GitNote> notes = JGitUtils.getNotesOnCommit(r, c);
|
| | |
| | | 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().processCommitMessage(
|
| | | repositoryName, entry.content)).setEscapeModelStrings(false));
|
| | | 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, c);
|
| | | |
| | | // add commit diffstat
|
| | | int insertions = 0;
|
| | | int deletions = 0;
|
| | | for (PathChangeModel pcm : paths) {
|
| | | insertions += pcm.insertions;
|
| | | deletions += pcm.deletions;
|
| | | }
|
| | | add(new DiffStatPanel("diffStat", insertions, deletions));
|
| | | |
| | | add(new CommitLegendPanel("commitLegend", paths));
|
| | | ListDataProvider<PathChangeModel> pathsDp = new ListDataProvider<PathChangeModel>(paths);
|
| | | DataView<PathChangeModel> pathsView = new DataView<PathChangeModel>("changedPath", pathsDp) {
|
| | |
| | | WicketUtils.setChangeTypeCssClass(changeType, entry.changeType);
|
| | | setChangeTypeTooltip(changeType, entry.changeType);
|
| | | item.add(changeType);
|
| | | |
| | | item.add(new DiffStatPanel("diffStat", entry.insertions, entry.deletions, true));
|
| | |
|
| | | boolean hasSubmodule = false;
|
| | | String submodulePath = null;
|
| | | if (entry.isTree()) {
|