]> source.dussan.org Git - gitblit.git/commitdiff
Moved paging count to setting. Fixed css layouts. Removed log pager.
authorJames Moger <james.moger@gitblit.com>
Mon, 11 Apr 2011 13:59:03 +0000 (09:59 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 11 Apr 2011 13:59:03 +0000 (09:59 -0400)
gitblit.properties
src/com/gitblit/wicket/pages/CommitPage.html
src/com/gitblit/wicket/pages/SummaryPage.html
src/com/gitblit/wicket/panels/BranchesPanel.html
src/com/gitblit/wicket/panels/LogPanel.html
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/TagsPanel.html
src/com/gitblit/wicket/resources/gitblit.css

index 2f03da09c4000a071db33ea5f532c806bb5de1a8..9174b335b5a9524145b595b978991b7bd833cd4a 100644 (file)
@@ -77,6 +77,9 @@ summaryCommitCount = 20
 # Value must exceed 0 else default of 5 is used\r
 summaryRefsCount = 5\r
 \r
+# The number of commits to show on each page of a Log\r
+logPageCommitsCount = 50\r
+\r
 # Registered extensions for google-code-prettify\r
 prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
 \r
index e3434c45f189b5c1c2c84e66fdea9b2c3c568355..0614c0636b2965b6500ef3317f9a350750da234e 100644 (file)
@@ -35,7 +35,7 @@
        <div class="commit_message" wicket:id="fullMessage">[commit message]</div>\r
        \r
        <!-- changed paths -->\r
-       <table class="pretty">\r
+       <table style="border-top:1px solid #bbb;" class="pretty">\r
                <tr wicket:id="changedPath">\r
                        <td class="path"><span wicket:id="pathName">[commit path]</span></td>                   \r
                        <td>\r
index 4151640ae087f926ad12f92bec41aec978cceac2..7075bd2ccadd7cabb66cc083f7f2f3242cda52b8 100644 (file)
        </div>\r
 \r
        <!-- commits -->\r
-       <div wicket:id="commitsPanel">[commits panel]</div>     \r
+       <div style="padding-bottom:10px;" wicket:id="commitsPanel">[commits panel]</div>        \r
 \r
        <!-- branches -->\r
-       <div style="width:400px; float:left;">\r
+       <div style="padding-bottom:10px;width:400px; float:left;">\r
                <div wicket:id="branchesPanel">[branches panel]</div>\r
        </div>\r
 \r
        <!-- tags -->\r
-       <div style="margin-left:405px;">\r
+       <div style="padding-bottom:10px;margin-left:405px;">\r
                <div wicket:id="tagsPanel">[tags panel]</div>\r
        </div>\r
        \r
index 50a1681261bb176036bc654bd74f8a5e0a4bbbdc..78774f2d4d6940b39037edd128022fee3ae72817 100644 (file)
@@ -27,8 +27,6 @@
 \r
        <div wicket:id="allBranches">[all branches]</div>       \r
                \r
-       <!-- spacer -->\r
-       <div style="padding:5px;"></div>\r
 </wicket:panel>\r
 </body>\r
 </html>
\ No newline at end of file
index e342f00651cf9cb17962802d0d56593560f961f1..e12d1b8f2d421889f712ec83d1bb5ebd68ced578 100644 (file)
                        </tr>\r
        </tbody>\r
        </table>        \r
-       <div class="pager" wicket:id="pageLogs">[pager]</div>\r
        <div wicket:id="moreLogs">[more...]</div>\r
        \r
-       <!-- spacer -->\r
-       <div style="padding:5px;"></div>\r
 </wicket:panel>\r
 </body>\r
 </html>
\ No newline at end of file
index 077ebb913ef2a4c3e92765966e8dfcdd61a6ea79..8a22de1e18a6f57da2dab82f1010bad5dcd715f4 100644 (file)
@@ -4,7 +4,6 @@ import java.util.Date;
 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
@@ -16,8 +15,8 @@ import org.eclipse.jgit.lib.ObjectId;
 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
@@ -33,14 +32,13 @@ public class LogPanel extends Panel {
 \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
@@ -89,28 +87,18 @@ public class LogPanel extends Panel {
                                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
index 599412d642fe2e6d7eca7d953d40bdf15d5fb55e..8b90655099cfd4ba601465308a61996c9790a87d 100644 (file)
@@ -25,9 +25,7 @@
        </table>\r
        \r
        <div wicket:id="allTags">[all tags]</div>       \r
-               \r
-       <!-- spacer -->\r
-       <div style="padding:5px;"></div>\r
+\r
 </wicket:panel>\r
 </body>\r
 </html>
\ No newline at end of file
index 42ab2c0c48ff9670b8ea0ad8fdcf8f78842863cb..6c754323d19a15835d84d2ca280fa27277ac6577 100644 (file)
@@ -187,7 +187,7 @@ div.page_path {
 div.commit_message {\r
        padding: 8px;\r
        border: solid #bbb;\r
-       border-width: 1px 0px 1px;\r
+       border-width: 1px 0px 0px;\r
 }\r
 \r
 div.bug_open, span.bug_open {\r
@@ -305,10 +305,8 @@ table.plain {
 }\r
 \r
 table.pretty, table.repositories {\r
-       margin-top:5px;\r
        margin-bottom:5px;\r
        border-spacing: 0px;\r
-       border-top: 1px solid #bbb;\r
        border-left: 1px solid #bbb;\r
        border-right: 1px solid #bbb;   \r
 }\r