From 9c4725cba1e4e07c55061afb435d0d4228cf89ba Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 4 Feb 2012 00:02:11 -0500 Subject: [PATCH] Clarify that log page/panel displays HEAD ref by default --- src/com/gitblit/wicket/pages/LogPage.java | 7 ++++++- src/com/gitblit/wicket/pages/SummaryPage.java | 2 +- src/com/gitblit/wicket/panels/LogPanel.java | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/gitblit/wicket/pages/LogPage.java b/src/com/gitblit/wicket/pages/LogPage.java index c012538f..d3dc3a9e 100644 --- a/src/com/gitblit/wicket/pages/LogPage.java +++ b/src/com/gitblit/wicket/pages/LogPage.java @@ -18,6 +18,7 @@ package com.gitblit.wicket.pages; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import com.gitblit.utils.StringUtils; import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.panels.LogPanel; @@ -31,7 +32,11 @@ public class LogPage extends RepositoryPage { int pageNumber = WicketUtils.getPage(params); int prevPage = Math.max(0, pageNumber - 1); int nextPage = pageNumber + 1; - LogPanel logPanel = new LogPanel("logPanel", repositoryName, objectId, getRepository(), -1, + String refid = objectId; + if (StringUtils.isEmpty(refid)) { + refid = getRepositoryModel().HEAD; + } + LogPanel logPanel = new LogPanel("logPanel", repositoryName, refid, getRepository(), -1, pageNumber - 1); boolean hasMore = logPanel.hasMore(); add(logPanel); diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 904ec44d..627fc5d8 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -129,7 +129,7 @@ public class SummaryPage extends RepositoryPage { add(new Label("otherUrls", StringUtils.flattenStrings(repositoryUrls, "
")) .setEscapeModelStrings(false)); - add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0)); + add(new LogPanel("commitsPanel", repositoryName, getRepositoryModel().HEAD, r, numberCommits, 0)); add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty()); add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs).hideIfEmpty()); diff --git a/src/com/gitblit/wicket/panels/LogPanel.java b/src/com/gitblit/wicket/panels/LogPanel.java index 90b6745f..74764d6d 100644 --- a/src/com/gitblit/wicket/panels/LogPanel.java +++ b/src/com/gitblit/wicket/panels/LogPanel.java @@ -76,13 +76,13 @@ public class LogPanel extends BasePanel { if (pageResults) { // shortlog page // show repository summary page link - add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, + add(new LinkPanel("header", "title", objectId, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName))); } 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))); } ListDataProvider dp = new ListDataProvider(commits); -- 2.39.5