From: James Moger Date: Mon, 11 Apr 2011 13:59:03 +0000 (-0400) Subject: Moved paging count to setting. Fixed css layouts. Removed log pager. X-Git-Tag: v0.5.0~96 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50984c55466228ccff0630e49acb4c5e271d446b;p=gitblit.git Moved paging count to setting. Fixed css layouts. Removed log pager. --- diff --git a/gitblit.properties b/gitblit.properties index 2f03da09..9174b335 100644 --- a/gitblit.properties +++ b/gitblit.properties @@ -77,6 +77,9 @@ summaryCommitCount = 20 # Value must exceed 0 else default of 5 is used summaryRefsCount = 5 +# The number of commits to show on each page of a Log +logPageCommitsCount = 50 + # Registered extensions for google-code-prettify prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb diff --git a/src/com/gitblit/wicket/pages/CommitPage.html b/src/com/gitblit/wicket/pages/CommitPage.html index e3434c45..0614c063 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.html +++ b/src/com/gitblit/wicket/pages/CommitPage.html @@ -35,7 +35,7 @@
[commit message]
- +
[commit path] diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index 4151640a..7075bd2c 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -28,15 +28,15 @@ -
[commits panel]
+
[commits panel]
-
+
[branches panel]
-
+
[tags panel]
diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.html b/src/com/gitblit/wicket/panels/BranchesPanel.html index 50a16812..78774f2d 100644 --- a/src/com/gitblit/wicket/panels/BranchesPanel.html +++ b/src/com/gitblit/wicket/panels/BranchesPanel.html @@ -27,8 +27,6 @@
[all branches]
- -
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/LogPanel.html b/src/com/gitblit/wicket/panels/LogPanel.html index e342f006..e12d1b8f 100644 --- a/src/com/gitblit/wicket/panels/LogPanel.html +++ b/src/com/gitblit/wicket/panels/LogPanel.html @@ -24,11 +24,8 @@
-
[pager]
[more...]
- -
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/LogPanel.java b/src/com/gitblit/wicket/panels/LogPanel.java index 077ebb91..8a22de1e 100644 --- a/src/com/gitblit/wicket/panels/LogPanel.java +++ b/src/com/gitblit/wicket/panels/LogPanel.java @@ -4,7 +4,6 @@ import java.util.Date; import java.util.List; import java.util.Map; -import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; import org.apache.wicket.markup.html.panel.Panel; @@ -16,8 +15,8 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; +import com.gitblit.StoredSettings; import com.gitblit.utils.JGitUtils; -import com.gitblit.wicket.GitBlitWebApp; import com.gitblit.wicket.GitBlitWebSession; import com.gitblit.wicket.LinkPanel; import com.gitblit.wicket.WicketUtils; @@ -33,14 +32,13 @@ public class LogPanel extends Panel { public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) { super(wicketId); - boolean pageResults = limit <= 0; - setOutputMarkupId(pageResults); - + boolean pageResults = limit <= 0; + int itemsPerPage = StoredSettings.getInteger("logPageCommitsCount", 50); final Map> allRefs = JGitUtils.getAllRefs(r); List commits; if (pageResults) { // Paging result set - commits = JGitUtils.getRevLog(r, objectId, pageOffset*GitBlitWebApp.PAGING_ITEM_COUNT, GitBlitWebApp.PAGING_ITEM_COUNT); + commits = JGitUtils.getRevLog(r, objectId, pageOffset * itemsPerPage, itemsPerPage); } else { // Fixed size result set commits = JGitUtils.getRevLog(r, objectId, 0, limit); @@ -89,28 +87,18 @@ public class LogPanel extends Panel { counter++; } }; - add(logView); + add(logView); // determine to show pager, more, or neither if (limit <= 0) { // no display limit add(new Label("moreLogs", "").setVisible(false)); - add(new Label("pageLogs", "").setVisible(false)); - } else { + } else { if (pageResults) { // paging add(new Label("moreLogs", "").setVisible(false)); - if (commits.size() == limit) { - // show pager - logView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT); - add(new AjaxPagingNavigator("pageLogs", logView)); - } else { - // nothing to page - add(new Label("pageLogs", "").setVisible(false)); - } } else { // more - add(new Label("pageLogs", "").setVisible(false)); if (commits.size() == limit) { // show more add(new LinkPanel("moreLogs", "link", new StringResourceModel("gb.moreLogs", this, null), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName))); diff --git a/src/com/gitblit/wicket/panels/TagsPanel.html b/src/com/gitblit/wicket/panels/TagsPanel.html index 599412d6..8b906550 100644 --- a/src/com/gitblit/wicket/panels/TagsPanel.html +++ b/src/com/gitblit/wicket/panels/TagsPanel.html @@ -25,9 +25,7 @@
[all tags]
- - -
+ \ No newline at end of file diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css index 42ab2c0c..6c754323 100644 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ b/src/com/gitblit/wicket/resources/gitblit.css @@ -187,7 +187,7 @@ div.page_path { div.commit_message { padding: 8px; border: solid #bbb; - border-width: 1px 0px 1px; + border-width: 1px 0px 0px; } div.bug_open, span.bug_open { @@ -305,10 +305,8 @@ table.plain { } table.pretty, table.repositories { - margin-top:5px; margin-bottom:5px; border-spacing: 0px; - border-top: 1px solid #bbb; border-left: 1px solid #bbb; border-right: 1px solid #bbb; }