| | |
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.GitNote;
|
| | | import com.gitblit.models.SubmoduleModel;
|
| | | import com.gitblit.models.PathModel.PathChangeModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.GravatarImage;
|
| | | 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;
|
| | |
|
| | |
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit c = getCommit();
|
| | |
|
| | | |
| | | List<String> parents = new ArrayList<String>();
|
| | | if (c.getParentCount() > 0) {
|
| | | for (RevCommit parent : c.getParents()) {
|
| | |
| | | // author
|
| | | add(createPersonPanel("commitAuthor", c.getAuthorIdent(), Constants.SearchType.AUTHOR));
|
| | | add(WicketUtils.createTimestampLabel("commitAuthorDate", c.getAuthorIdent().getWhen(),
|
| | | getTimeZone()));
|
| | | add(new GravatarImage("authorAvatar", c.getAuthorIdent()));
|
| | | getTimeZone(), getTimeUtils()));
|
| | |
|
| | | // committer
|
| | | add(createPersonPanel("commitCommitter", c.getCommitterIdent(), Constants.SearchType.COMMITTER));
|
| | | add(WicketUtils.createTimestampLabel("commitCommitterDate",
|
| | | c.getCommitterIdent().getWhen(), getTimeZone()));
|
| | | c.getCommitterIdent().getWhen(), getTimeZone(), getTimeUtils()));
|
| | |
|
| | | add(new Label("commitId", c.getName()));
|
| | |
|
| | |
| | | Constants.SearchType.AUTHOR));
|
| | | item.add(new GravatarImage("noteAuthorAvatar", entry.notesRef.getAuthorIdent()));
|
| | | item.add(WicketUtils.createTimestampLabel("authorDate", entry.notesRef
|
| | | .getAuthorIdent().getWhen(), getTimeZone()));
|
| | | .getAuthorIdent().getWhen(), getTimeZone(), getTimeUtils()));
|
| | | item.add(new Label("noteContent", GitBlit.self().processCommitMessage(
|
| | | repositoryName, entry.content)).setEscapeModelStrings(false));
|
| | | }
|
| | |
| | | WicketUtils.setChangeTypeCssClass(changeType, entry.changeType);
|
| | | setChangeTypeTooltip(changeType, entry.changeType);
|
| | | item.add(changeType);
|
| | | |
| | | boolean hasSubmodule = false;
|
| | | String submodulePath = null;
|
| | | if (entry.isTree()) {
|
| | | // tree
|
| | | item.add(new LinkPanel("pathName", null, entry.path, TreePage.class,
|
| | | WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path)));
|
| | | } else if (entry.isSubmodule()) {
|
| | | // submodule
|
| | | String submoduleId = entry.objectId;
|
| | | SubmoduleModel submodule = getSubmodule(entry.path);
|
| | | submodulePath = submodule.gitblitPath;
|
| | | hasSubmodule = submodule.hasSubmodule;
|
| | | |
| | | item.add(new LinkPanel("pathName", "list", entry.path + " @ " +
|
| | | getShortObjectId(submoduleId), TreePage.class,
|
| | | WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));
|
| | | } else {
|
| | | // blob
|
| | | item.add(new LinkPanel("pathName", "list", entry.path, BlobPage.class,
|
| | | WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path)));
|
| | | }
|
| | |
|
| | | item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)
|
| | | && !entry.changeType.equals(ChangeType.DELETE)));
|
| | | item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path)));
|
| | | item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
|
| | | item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
|
| | | |
| | | // quick links
|
| | | if (entry.isSubmodule()) {
|
| | | // submodule |
| | | item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
|
| | | .newPathParameter(submodulePath, entry.objectId, entry.path))
|
| | | .setEnabled(false));
|
| | | item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils
|
| | | .newObjectParameter(submodulePath, entry.objectId)).setEnabled(hasSubmodule));
|
| | | item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils
|
| | | .newPathParameter(submodulePath, entry.objectId, entry.path))
|
| | | .setEnabled(false));
|
| | | item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
|
| | | .newPathParameter(submodulePath, entry.objectId, entry.path))
|
| | | .setEnabled(hasSubmodule));
|
| | | } else {
|
| | | // tree or blob
|
| | | item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)
|
| | | && !entry.changeType.equals(ChangeType.DELETE)));
|
| | | item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path)));
|
| | | item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
|
| | | item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
|
| | | .newPathParameter(repositoryName, entry.commitId, entry.path))
|
| | | .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
|
| | | }
|
| | |
|
| | | WicketUtils.setAlternatingBackground(item, counter);
|
| | | counter++;
|