]> source.dussan.org Git - gitblit.git/commitdiff
Clarify that log page/panel displays HEAD ref by default
authorJames Moger <james.moger@gitblit.com>
Sat, 4 Feb 2012 05:02:11 +0000 (00:02 -0500)
committerJames Moger <james.moger@gitblit.com>
Sat, 4 Feb 2012 05:02:11 +0000 (00:02 -0500)
src/com/gitblit/wicket/pages/LogPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/panels/LogPanel.java

index c012538f1c96c6349abe289c9be67fad9ba834d2..d3dc3a9e66a9edb1a51198d2c439c50e71e4a50c 100644 (file)
@@ -18,6 +18,7 @@ package com.gitblit.wicket.pages;
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 \r
+import com.gitblit.utils.StringUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.LogPanel;\r
 \r
@@ -31,7 +32,11 @@ public class LogPage extends RepositoryPage {
                int pageNumber = WicketUtils.getPage(params);\r
                int prevPage = Math.max(0, pageNumber - 1);\r
                int nextPage = pageNumber + 1;\r
-               LogPanel logPanel = new LogPanel("logPanel", repositoryName, objectId, getRepository(), -1,\r
+               String refid = objectId;\r
+               if (StringUtils.isEmpty(refid)) {\r
+                       refid = getRepositoryModel().HEAD;\r
+               }\r
+               LogPanel logPanel = new LogPanel("logPanel", repositoryName, refid, getRepository(), -1,\r
                                pageNumber - 1);\r
                boolean hasMore = logPanel.hasMore();\r
                add(logPanel);\r
index 904ec44dbc963727544014105101108c21492dfe..627fc5d8bebfde6e7f6f8357855fdb4bf1d81a0a 100644 (file)
@@ -129,7 +129,7 @@ public class SummaryPage extends RepositoryPage {
                add(new Label("otherUrls", StringUtils.flattenStrings(repositoryUrls, "<br/>"))\r
                .setEscapeModelStrings(false));\r
 \r
-               add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));\r
+               add(new LogPanel("commitsPanel", repositoryName, getRepositoryModel().HEAD, r, numberCommits, 0));\r
                add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());\r
                add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs).hideIfEmpty());\r
 \r
index 90b6745fb2ba6e636c23d2069c0dcf4511990f0d..74764d6d2a4c66f674d63df03db2e3dc78fdf60c 100644 (file)
@@ -76,13 +76,13 @@ public class LogPanel extends BasePanel {
                if (pageResults) {\r
                        // shortlog page\r
                        // show repository summary page link\r
-                       add(new LinkPanel("header", "title", repositoryName, SummaryPage.class,\r
+                       add(new LinkPanel("header", "title", objectId, SummaryPage.class,\r
                                        WicketUtils.newRepositoryParameter(repositoryName)));\r
                } else {\r
                        // summary page\r
                        // show shortlog page link\r
-                       add(new LinkPanel("header", "title", new StringResourceModel("gb.log", this, null),\r
-                                       LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                       add(new LinkPanel("header", "title", objectId, LogPage.class,\r
+                                       WicketUtils.newRepositoryParameter(repositoryName)));\r
                }\r
 \r
                ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r