| | |
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.RefModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.JGitUtils.SearchType;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.GitBlitWebApp;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.pages.BasePage;
|
| | | import com.gitblit.wicket.pages.CommitDiffPage;
|
| | | import com.gitblit.wicket.pages.CommitPage;
|
| | | import com.gitblit.wicket.pages.LogPage;
|
| | | import com.gitblit.wicket.pages.SearchPage;
|
| | | import com.gitblit.wicket.pages.SummaryPage;
|
| | | import com.gitblit.wicket.pages.TreePage;
|
| | |
|
| | | public class LogPanel extends BasePanel {
|
| | |
| | | itemsPerPage = 50;
|
| | | }
|
| | |
|
| | | final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);
|
| | | final Map<ObjectId, List<RefModel>> allRefs = JGitUtils.getAllRefs(r);
|
| | | List<RevCommit> commits;
|
| | | if (pageResults) {
|
| | | // Paging result set
|
| | |
| | | // header
|
| | | if (pageResults) {
|
| | | // shortlog page
|
| | | // show repository summary page link
|
| | | add(new LinkPanel("header", "title", repositoryName, SummaryPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | add(new Label("header", objectId));
|
| | | } else {
|
| | | // summary page
|
| | | // show shortlog page link
|
| | | add(new LinkPanel("header", "title", new StringResourceModel("gb.log", this, null),
|
| | | LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | add(new LinkPanel("header", "title", objectId, LogPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | }
|
| | |
|
| | | GitBlitWebApp app = (GitBlitWebApp) GitBlitWebSession.get().getApplication();
|
| | | final Class<? extends BasePage> searchPageClass = app.getSearchPageClass();
|
| | |
|
| | | ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);
|
| | | DataView<RevCommit> logView = new DataView<RevCommit>("commit", dp) {
|
| | |
| | | // author search link
|
| | | String author = entry.getAuthorIdent().getName();
|
| | | LinkPanel authorLink = new LinkPanel("commitAuthor", "list", author,
|
| | | SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId,
|
| | | author, SearchType.AUTHOR));
|
| | | setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);
|
| | | searchPageClass, WicketUtils.newSearchParameter(repositoryName, objectId,
|
| | | author, Constants.SearchType.AUTHOR));
|
| | | setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);
|
| | | item.add(authorLink);
|
| | |
|
| | | // merge icon
|
| | |
| | |
|
| | | // short message
|
| | | String shortMessage = entry.getShortMessage();
|
| | | String trimmedMessage = StringUtils.trimShortLog(shortMessage);
|
| | | String trimmedMessage = shortMessage;
|
| | | if (allRefs.containsKey(entry.getId())) {
|
| | | trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG_REFS);
|
| | | } else {
|
| | | trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG);
|
| | | }
|
| | | LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject",
|
| | | trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(
|
| | | repositoryName, entry.getName()));
|
| | |
| | | item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils
|
| | | .newObjectParameter(repositoryName, entry.getName())));
|
| | | item.add(new BookmarkablePageLink<Void>("diff", CommitDiffPage.class, WicketUtils
|
| | | .newObjectParameter(repositoryName, entry.getName())).setEnabled(entry.getParentCount() > 0));
|
| | | .newObjectParameter(repositoryName, entry.getName())).setEnabled(entry
|
| | | .getParentCount() > 0));
|
| | | item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils
|
| | | .newObjectParameter(repositoryName, entry.getName())));
|
| | |
|