import java.util.List;\r
import java.util.Map;\r
\r
-import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.panel.Panel;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
+import com.gitblit.StoredSettings;\r
import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebApp;\r
import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
\r
public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
- boolean pageResults = limit <= 0; \r
- setOutputMarkupId(pageResults);\r
- \r
+ boolean pageResults = limit <= 0;\r
+ int itemsPerPage = StoredSettings.getInteger("logPageCommitsCount", 50);\r
final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
List<RevCommit> commits;\r
if (pageResults) {\r
// Paging result set\r
- commits = JGitUtils.getRevLog(r, objectId, pageOffset*GitBlitWebApp.PAGING_ITEM_COUNT, GitBlitWebApp.PAGING_ITEM_COUNT);\r
+ commits = JGitUtils.getRevLog(r, objectId, pageOffset * itemsPerPage, itemsPerPage);\r
} else {\r
// Fixed size result set\r
commits = JGitUtils.getRevLog(r, objectId, 0, limit);\r
counter++;\r
}\r
};\r
- add(logView); \r
+ add(logView);\r
\r
// determine to show pager, more, or neither\r
if (limit <= 0) {\r
// no display limit\r
add(new Label("moreLogs", "").setVisible(false));\r
- add(new Label("pageLogs", "").setVisible(false));\r
- } else { \r
+ } else {\r
if (pageResults) {\r
// paging\r
add(new Label("moreLogs", "").setVisible(false));\r
- if (commits.size() == limit) {\r
- // show pager\r
- logView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT);\r
- add(new AjaxPagingNavigator("pageLogs", logView));\r
- } else {\r
- // nothing to page\r
- add(new Label("pageLogs", "").setVisible(false));\r
- }\r
} else {\r
// more\r
- add(new Label("pageLogs", "").setVisible(false));\r
if (commits.size() == limit) {\r
// show more\r
add(new LinkPanel("moreLogs", "link", new StringResourceModel("gb.moreLogs", this, null), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r