]> source.dussan.org Git - gitblit.git/commitdiff
created panels for logs, tags, and branches.
authorJames Moger <james.moger@gitblit.com>
Fri, 8 Apr 2011 21:17:28 +0000 (17:17 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 8 Apr 2011 21:17:28 +0000 (17:17 -0400)
47 files changed:
src/com/gitblit/wicket/BasePage.java
src/com/gitblit/wicket/GitBlitWebApp.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/RepositoryPage.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/models/RefModel.java
src/com/gitblit/wicket/pages/BlobPage.html
src/com/gitblit/wicket/pages/BranchesPage.html
src/com/gitblit/wicket/pages/BranchesPage.java
src/com/gitblit/wicket/pages/CommitPage.html
src/com/gitblit/wicket/pages/CommitPage.java
src/com/gitblit/wicket/pages/LogPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/LogPage.java [new file with mode: 0644]
src/com/gitblit/wicket/pages/ShortLogPage.html [deleted file]
src/com/gitblit/wicket/pages/ShortLogPage.java [deleted file]
src/com/gitblit/wicket/pages/SummaryPage.html
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TagsPage.html
src/com/gitblit/wicket/pages/TagsPage.java
src/com/gitblit/wicket/pages/TicGitPage.html
src/com/gitblit/wicket/pages/TicGitPage.java
src/com/gitblit/wicket/pages/TicGitTicketPage.html
src/com/gitblit/wicket/pages/TicGitTicketPage.java
src/com/gitblit/wicket/panels/AdminLinksPanel.java
src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/BasePanel.java [deleted file]
src/com/gitblit/wicket/panels/BranchLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/BranchLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/BranchesPanel.html [new file with mode: 0644]
src/com/gitblit/wicket/panels/BranchesPanel.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/LogPanel.html [new file with mode: 0644]
src/com/gitblit/wicket/panels/LogPanel.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/PageLinksPanel.html
src/com/gitblit/wicket/panels/PageLinksPanel.java
src/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java
src/com/gitblit/wicket/panels/PathLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/PathLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/ShortLogLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/ShortLogLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/TagLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/TagLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/TagsPanel.html [new file with mode: 0644]
src/com/gitblit/wicket/panels/TagsPanel.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/TreeBlobLinksPanel.java
src/com/gitblit/wicket/panels/TreeLinksPanel.java
src/com/gitblit/wicket/resources/gitblit.css

index d24485f72363c1339adbd7a19202d55a6d90cfce..d795c615ceb5e9f2ce8813c694fb278a45d6c364 100644 (file)
@@ -1,10 +1,7 @@
 package com.gitblit.wicket;\r
 \r
-import java.util.Date;\r
-\r
 import javax.servlet.http.HttpServletRequest;\r
 \r
-import org.apache.wicket.Component;\r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.WebPage;\r
 import org.apache.wicket.markup.html.basic.Label;\r
@@ -14,10 +11,8 @@ import org.slf4j.LoggerFactory;
 \r
 import com.gitblit.Constants;\r
 import com.gitblit.StoredSettings;\r
-import com.gitblit.utils.Utils;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 \r
-\r
 public abstract class BasePage extends WebPage {\r
 \r
        Logger logger = LoggerFactory.getLogger(BasePage.class);\r
@@ -58,49 +53,7 @@ public abstract class BasePage extends WebPage {
                HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
                return req.getServerName();\r
        }\r
-\r
-       protected Label createAuthorLabel(String wicketId, String author) {\r
-               Label label = new Label(wicketId, author);\r
-               WicketUtils.setHtmlTitle(label, author);\r
-               return label;\r
-       }\r
-\r
-       protected Label createDateLabel(String wicketId, Date date) {\r
-               Label label = new Label(wicketId, GitBlitWebSession.get().formatDate(date));\r
-               WicketUtils.setCssClass(label, Utils.timeAgoCss(date));\r
-               WicketUtils.setHtmlTitle(label, Utils.timeAgo(date));\r
-               return label;\r
-       }\r
-\r
-       protected Label createShortlogDateLabel(String wicketId, Date date) {\r
-               String dateString = GitBlitWebSession.get().formatDate(date);\r
-               String title = Utils.timeAgo(date);\r
-               if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000l) {\r
-                       dateString = title;\r
-                       title = GitBlitWebSession.get().formatDate(date);\r
-               }\r
-               Label label = new Label(wicketId, dateString);\r
-               WicketUtils.setCssClass(label, Utils.timeAgoCss(date));\r
-               WicketUtils.setHtmlTitle(label, title);\r
-               return label;\r
-       }\r
-\r
-       protected void setAlternatingBackground(Component c, int i) {\r
-               String clazz = i % 2 == 0 ? "dark" : "light";\r
-               WicketUtils.setCssClass(c, clazz);\r
-       }\r
-\r
-       protected String trimShortLog(String string) {\r
-               return trimString(string, 60);\r
-       }\r
        \r
-       protected String trimString(String value, int max) {\r
-               if (value.length() <= max) {\r
-                       return value;\r
-               }\r
-               return value.substring(0, max - 3) + "...";\r
-       }\r
-\r
        public void error(String message, Throwable t) {\r
                super.error(message);\r
                logger.error(message, t);\r
index 70bb97025330732caac632c82eb698757101928c..caaf221fc0adfba618e737d7d6df925122a7e3cc 100644 (file)
@@ -33,7 +33,7 @@ import com.gitblit.wicket.pages.BranchesPage;
 import com.gitblit.wicket.pages.CommitPage;\r
 import com.gitblit.wicket.pages.DiffPage;\r
 import com.gitblit.wicket.pages.RepositoriesPage;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
+import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TagPage;\r
 import com.gitblit.wicket.pages.TagsPage;\r
@@ -63,7 +63,7 @@ public class GitBlitWebApp extends WebApplication {
 \r
                // setup the standard gitweb-ish urls\r
                mount(new MixedParamUrlCodingStrategy("/summary", SummaryPage.class, new String[] { "p" }));\r
-               mount(new MixedParamUrlCodingStrategy("/shortlog", ShortLogPage.class, new String[] { "p", "h" }));\r
+               mount(new MixedParamUrlCodingStrategy("/shortlog", LogPage.class, new String[] { "p", "h" }));\r
                mount(new MixedParamUrlCodingStrategy("/tags", TagsPage.class, new String[] { "p" }));\r
                mount(new MixedParamUrlCodingStrategy("/branches", BranchesPage.class, new String[] { "p" }));\r
                mount(new MixedParamUrlCodingStrategy("/commit", CommitPage.class, new String[] { "p", "h" }));\r
index ba077c7949bc766d2f0023aec944bd123ffb4af7..621cb718e0d08fd043aa0af00864b2896adba5c4 100644 (file)
@@ -25,10 +25,10 @@ gb.remote = remote
 gb.branches = branches\r
 gb.patch = patch\r
 gb.diff = diff\r
-gb.shortlog = shortlog\r
-gb.more = more\r
-gb.allTags = all tags\r
-gb.allBranches = all branches\r
+gb.log = log\r
+gb.moreLogs = more commits...\r
+gb.allTags = all tags...\r
+gb.allBranches = all branches...\r
 gb.summary = summary\r
 gb.ticket = ticket\r
 gb.newRepository = new repository\r
index 1a764a3d48c4744bdfdeaa7f34d78ea4cb30bc63..0cbda3dd2d2c86a479049df704e88044b8a77583 100644 (file)
@@ -33,7 +33,7 @@ public abstract class RepositoryPage extends BasePage {
                        redirectToInterceptPage(new RepositoriesPage());\r
                }\r
                repositoryName = params.getString("p", "");\r
-               commitId = params.getString("h", "");\r
+               commitId = params.getString("h", "HEAD");\r
 \r
                Repository r = getRepository();\r
 \r
@@ -112,24 +112,18 @@ public abstract class RepositoryPage extends BasePage {
        }\r
 \r
        protected PageParameters newRepositoryParameter() {\r
-               return new PageParameters("p=" + repositoryName);\r
+               return WicketUtils.newRepositoryParameter(repositoryName);\r
        }\r
 \r
        protected PageParameters newCommitParameter() {\r
-               return newCommitParameter(commitId);\r
+               return WicketUtils.newCommitParameter(repositoryName, commitId);\r
        }\r
 \r
        protected PageParameters newCommitParameter(String commitId) {\r
-               if (commitId == null || commitId.trim().length() == 0) {\r
-                       return newRepositoryParameter();\r
-               }\r
-               return new PageParameters("p=" + repositoryName + ",h=" + commitId);\r
+               return WicketUtils.newCommitParameter(repositoryName, commitId);\r
        }\r
 \r
        protected PageParameters newPathParameter(String path) {\r
-               if (path == null || path.trim().length() == 0) {\r
-                       return newCommitParameter();\r
-               }\r
-               return new PageParameters("p=" + repositoryName + ",h=" + commitId + ",f=" + path);\r
+               return WicketUtils.newPathParameter(repositoryName, commitId, path);\r
        }\r
 }\r
index ee055c1f9795063f4e7b2c59f67007f1fb4d40f6..63efd5487144c89047e693326236af9e5f17189f 100644 (file)
@@ -1,9 +1,18 @@
 package com.gitblit.wicket;\r
 \r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Date;\r
 import java.util.List;\r
+import java.util.TimeZone;\r
 \r
 import org.apache.wicket.Component;\r
+import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.behavior.SimpleAttributeModifier;\r
+import org.apache.wicket.markup.html.basic.Label;\r
+\r
+import com.gitblit.StoredSettings;\r
+import com.gitblit.utils.Utils;\r
 \r
 public class WicketUtils {\r
 \r
@@ -46,4 +55,62 @@ public class WicketUtils {
                }\r
                return sb.toString().trim();\r
        }\r
+       \r
+       public static void setAlternatingBackground(Component c, int i) {\r
+               String clazz = i % 2 == 0 ? "dark" : "light";\r
+               setCssClass(c, clazz);\r
+       }\r
+       \r
+       public static Label createAuthorLabel(String wicketId, String author) {\r
+               Label label = new Label(wicketId, author);\r
+               WicketUtils.setHtmlTitle(label, author);\r
+               return label;\r
+       }\r
+\r
+       public static String trimShortLog(String string) {\r
+               return trimString(string, 60);\r
+       }\r
+       \r
+       public static String trimString(String value, int max) {\r
+               if (value.length() <= max) {\r
+                       return value;\r
+               }\r
+               return value.substring(0, max - 3) + "...";\r
+       }\r
+       \r
+       public static PageParameters newRepositoryParameter(String repositoryName) {\r
+               return new PageParameters("p=" + repositoryName);\r
+       }\r
+\r
+       public static PageParameters newCommitParameter(String repositoryName, String commitId) {\r
+               if (commitId == null || commitId.trim().length() == 0) {\r
+                       return newRepositoryParameter(repositoryName);\r
+               }\r
+               return new PageParameters("p=" + repositoryName + ",h=" + commitId);\r
+       }\r
+\r
+       public static PageParameters newPathParameter(String repositoryName, String commitId, String path) {\r
+               if (path == null || path.trim().length() == 0) {\r
+                       return newCommitParameter(repositoryName, commitId);\r
+               }\r
+               return new PageParameters("p=" + repositoryName + ",h=" + commitId + ",f=" + path);\r
+       }\r
+       \r
+       public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {\r
+               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampShortFormat", "MM/dd/yy"));\r
+               if (timeZone != null) {\r
+                       df.setTimeZone(timeZone);\r
+               }\r
+               String dateString = df.format(date);\r
+               String title = Utils.timeAgo(date);\r
+               if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000l) {\r
+                       String tmp = dateString;\r
+                       dateString = title;\r
+                       title = tmp;\r
+               }\r
+               Label label = new Label(wicketId, dateString);\r
+               WicketUtils.setCssClass(label, Utils.timeAgoCss(date));\r
+               WicketUtils.setHtmlTitle(label, title);\r
+               return label;\r
+       }\r
 }\r
index 08de1105682924243ed6f79aa2f81052f71cab23..0c784340c14610fb3051ff887cd40d1128f1abb3 100644 (file)
@@ -52,7 +52,8 @@ public class RefModel implements Serializable, Comparable<RefModel> {
        }\r
        \r
        public boolean isAnnotatedTag() {\r
-               return ref.isPeeled();\r
+               // ref.isPeeled() ??\r
+               return !getCommitId().equals(getObjectId());\r
        }\r
                \r
        @Override\r
index 913ab0bc9d58f71bea28556458de1b8692b1821a..82ba32029f85741a84e79288fe0d6def65ef4c4e 100644 (file)
@@ -31,7 +31,7 @@
                <div wicket:id="breadcrumbs">[breadcrumbs]</div>\r
                \r
                <!--  blob content -->\r
-               <pre wicket:id="blobText">[blob content]</pre>\r
+               <pre style="border:0px;" wicket:id="blobText">[blob content]</pre>\r
        \r
 </body>\r
 </wicket:extend>\r
index 33d50825b9450eef06ed9adac7e25f5fb8b4c548..606cbf4be667cabd7fcbc3bf811d58c4aa5846f8 100644 (file)
@@ -9,20 +9,10 @@
 \r
        <!-- page nav links --> \r
        <div wicket:id="pageLinks">[page links]</div>\r
-       \r
-       <!-- shortlog -->       \r
-       <div style="margin-top:5px;" class="header" wicket:id="summary">[header]</div>  \r
-       <table class="pretty">\r
-               <tbody>\r
-                       <tr wicket:id="branch">\r
-                       <td class="date"><span wicket:id="branchDate">[branch date]</span></td>\r
-                       <td><div wicket:id="branchName">[branch name]</div></td>\r
-                       <td><div wicket:id="branchType">[branch type]</div></td>\r
-                       <td class="rightAlign"><span wicket:id="branchLinks">[branch links]</span></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
 \r
+       <!-- branches -->       \r
+       <div style="margin-top:5px;" wicket:id="branchesPanel">[branches panel]</div>\r
+       \r
 </wicket:extend>\r
 </body>\r
 </html>
\ No newline at end of file
index 30fac1a832950dafdeb1cce1658c37bdb9b6a97e..f4359d81d44f484fc4a628b317434ac8a86661f4 100644 (file)
@@ -1,23 +1,9 @@
 package com.gitblit.wicket.pages;\r
 \r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
 import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.repeater.Item;\r
-import org.apache.wicket.markup.repeater.data.DataView;\r
-import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.eclipse.jgit.lib.Constants;\r
-import org.eclipse.jgit.lib.Repository;\r
 \r
-import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.Utils;\r
-import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.RepositoryPage;\r
-import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.panels.BranchLinksPanel;\r
+import com.gitblit.wicket.panels.BranchesPanel;\r
 \r
 \r
 public class BranchesPage extends RepositoryPage {\r
@@ -25,44 +11,7 @@ public class BranchesPage extends RepositoryPage {
        public BranchesPage(PageParameters params) {\r
                super(params);\r
 \r
-               Repository r = getRepository();\r
-               List<RefModel> branches = new ArrayList<RefModel>();\r
-               branches.addAll(JGitUtils.getLocalBranches(r, -1));\r
-               branches.addAll(JGitUtils.getRemoteBranches(r, -1));\r
-\r
-               // shortlog\r
-               add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
-\r
-               ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);\r
-               DataView<RefModel> branchView = new DataView<RefModel>("branch", branchesDp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RefModel> item) {\r
-                               final RefModel entry = item.getModelObject();\r
-                               String date;\r
-                               if (entry.getDate() != null) {\r
-                                       date = Utils.timeAgo(entry.getDate());\r
-                               } else {\r
-                                       date = "";\r
-                               }\r
-                               Label branchDateLabel = new Label("branchDate", date);\r
-                               item.add(branchDateLabel);\r
-                               WicketUtils.setCssClass(branchDateLabel, Utils.timeAgoCss(entry.getDate()));\r
-\r
-                               item.add(new LinkPanel("branchName", "list name", entry.getDisplayName(), ShortLogPage.class, newCommitParameter(entry.getName())));\r
-\r
-                               boolean remote = entry.getName().startsWith(Constants.R_REMOTES);\r
-                               item.add(new Label("branchType", remote ? getString("gb.remote"):getString("gb.local")));\r
-                               \r
-                               item.add(new BranchLinksPanel("branchLinks", repositoryName, entry));\r
-                               \r
-                               String clazz = counter % 2 == 0 ? "dark" : "light";\r
-                               WicketUtils.setCssClass(item, clazz);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(branchView);\r
+               add(new BranchesPanel("branchesPanel", repositoryName, getRepository(), -1));\r
        }\r
        \r
        @Override\r
index 1b79e63780aa6a2db7dc65c36587068a0713a80e..e49cd5764b42b4a8479a0a12d401b1e224652bcc 100644 (file)
        <table class="pretty">\r
                <tr wicket:id="changedPath">\r
                        <td class="path"><span wicket:id="pathName">[commit path]</span></td>                   \r
-                       <td><span wicket:id="pathLinks">[path links]</span></td>\r
+                       <td>\r
+                               <div class="link">\r
+                                       <a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
+                               </div>\r
+                       </td>\r
                </tr>\r
        </table>\r
        \r
index f460827717a66f29318525510595d85189db251a..b0a92b064cbf96bee7e4f36162d0ea39b5bc6dcc 100644 (file)
@@ -5,6 +5,7 @@ import java.util.List;
 \r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
@@ -17,7 +18,6 @@ import com.gitblit.wicket.LinkPanel;
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.PathModel;\r
-import com.gitblit.wicket.panels.PathLinksPanel;\r
 \r
 \r
 public class CommitPage extends RepositoryPage {\r
@@ -45,7 +45,7 @@ public class CommitPage extends RepositoryPage {
                }\r
                add(new Label("patchLink", getString("gb.patch")));\r
                \r
-               add(new LinkPanel("shortlog", "title", c.getShortMessage(), ShortLogPage.class, newRepositoryParameter()));\r
+               add(new LinkPanel("shortlog", "title", c.getShortMessage(), LogPage.class, newRepositoryParameter()));\r
                \r
                addRefs(r, c);\r
 \r
@@ -89,9 +89,12 @@ public class CommitPage extends RepositoryPage {
                                } else {\r
                                        item.add(new LinkPanel("pathName", "list", entry.path, BlobPage.class, newPathParameter(entry.path)));\r
                                }\r
-                               item.add(new PathLinksPanel("pathLinks", repositoryName, entry));\r
-                               String clazz = counter % 2 == 0 ? "dark" : "light";\r
-                               WicketUtils.setCssClass(item, clazz);\r
+                               \r
+                               item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, newPathParameter(entry.path)));\r
+                               item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, newPathParameter(entry.path)));\r
+                               item.add(new BookmarkablePageLink<Void>("history", BlobPage.class).setEnabled(false));\r
+\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
                };\r
diff --git a/src/com/gitblit/wicket/pages/LogPage.html b/src/com/gitblit/wicket/pages/LogPage.html
new file mode 100644 (file)
index 0000000..82abb1b
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml"  \r
+      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
+      xml:lang="en"  \r
+      lang="en"> \r
+\r
+<body>\r
+<wicket:extend>\r
+\r
+       <!-- page nav links --> \r
+       <div wicket:id="pageLinks">[page links]</div>\r
+\r
+       <!-- log -->\r
+       <div style="margin-top:5px;" wicket:id="logPanel">[log panel]</div>\r
+       \r
+</wicket:extend>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/LogPage.java b/src/com/gitblit/wicket/pages/LogPage.java
new file mode 100644 (file)
index 0000000..56ab07a
--- /dev/null
@@ -0,0 +1,21 @@
+package com.gitblit.wicket.pages;\r
+\r
+import org.apache.wicket.PageParameters;\r
+\r
+import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.panels.LogPanel;\r
+\r
+\r
+public class LogPage extends RepositoryPage {\r
+\r
+       public LogPage(PageParameters params) {\r
+               super(params);\r
+\r
+               add(new LogPanel("logPanel", repositoryName, getRepository(), 100, true));\r
+       }\r
+       \r
+       @Override\r
+       protected String getPageName() {\r
+               return getString("gb.log");\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/pages/ShortLogPage.html b/src/com/gitblit/wicket/pages/ShortLogPage.html
deleted file mode 100644 (file)
index 3336931..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<body>\r
-<wicket:extend>\r
-\r
-       <!-- page nav links --> \r
-       <div wicket:id="pageLinks">[page links]</div>\r
-       \r
-       <!-- shortlog -->       \r
-       <div style="margin-top:5px;" class="header" wicket:id="summary">[shortlog header]</div> \r
-       <table style="width:100%" "class="pretty">\r
-               <tbody>\r
-                       <tr wicket:id="commit">\r
-                       <td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
-                       <td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
-                       <td><div wicket:id="commitShortMessage">[commit short message]</div></td>\r
-                       <td class="rightAlign"><div wicket:id="commitRefs">[commit refs]</div></td>                     \r
-                       <td class="rightAlign"><span wicket:id="commitLinks">[commit links]</span></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
-       <div class="pager" wicket:id="navigator">[pager]</div>\r
-       \r
-</wicket:extend>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/ShortLogPage.java b/src/com/gitblit/wicket/pages/ShortLogPage.java
deleted file mode 100644 (file)
index c83050d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.gitblit.wicket.pages;\r
-\r
-import java.util.Date;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;\r
-import org.apache.wicket.markup.repeater.Item;\r
-import org.apache.wicket.markup.repeater.data.DataView;\r
-import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.eclipse.jgit.lib.ObjectId;\r
-import org.eclipse.jgit.lib.Repository;\r
-import org.eclipse.jgit.revwalk.RevCommit;\r
-\r
-import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.GitBlitWebApp;\r
-import com.gitblit.wicket.LinkPanel;\r
-import com.gitblit.wicket.RepositoryPage;\r
-import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.panels.RefsPanel;\r
-import com.gitblit.wicket.panels.ShortLogLinksPanel;\r
-\r
-\r
-public class ShortLogPage extends RepositoryPage {\r
-\r
-       public ShortLogPage(PageParameters params) {\r
-               super(params);\r
-\r
-               Repository r = getRepository();\r
-               final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
-               List<RevCommit> commits = JGitUtils.getRevLog(r, 100);\r
-\r
-               // shortlog\r
-               add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
-\r
-               ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
-               DataView<RevCommit> shortlogView = new DataView<RevCommit>("commit", dp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RevCommit> item) {\r
-                               final RevCommit entry = item.getModelObject();\r
-                               final Date date = JGitUtils.getCommitDate(entry);\r
-\r
-                               item.add(createShortlogDateLabel("commitDate", date));\r
-\r
-                               String author = entry.getAuthorIdent().getName();\r
-                               item.add(createAuthorLabel("commitAuthor", author));\r
-\r
-                               String shortMessage = entry.getShortMessage();\r
-                               String trimmedMessage = trimShortLog(shortMessage);\r
-                               LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, newCommitParameter(entry.getName()));\r
-                               if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
-                               }\r
-                               item.add(shortlog);\r
-                               \r
-                               item.add(new RefsPanel("commitRefs", entry, allRefs));\r
-                               \r
-                               item.add(new ShortLogLinksPanel("commitLinks", repositoryName, entry.getName()));\r
-\r
-                               String clazz = counter % 2 == 0 ? "dark" : "light";\r
-                               WicketUtils.setCssClass(item, clazz);\r
-                               counter++;\r
-                       }\r
-               };\r
-               shortlogView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT);\r
-               add(shortlogView);\r
-               add(new PagingNavigator("navigator", shortlogView));\r
-       }\r
-       \r
-       @Override\r
-       protected String getPageName() {\r
-               return getString("gb.shortlog");\r
-       }\r
-}\r
index cba149e5f930190d3d643c309f77b49d9d1297e1..4151640ae087f926ad12f92bec41aec978cceac2 100644 (file)
                </div>\r
        </div>\r
 \r
-       <!-- shortlog -->\r
-       <div class="header" wicket:id="shortlog">[shortlog header]</div>        \r
-       <table style="width:100%" class="pretty">\r
-               <tbody>\r
-                       <tr wicket:id="commit">\r
-                       <td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
-                       <td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
-                       <td><div wicket:id="commitShortMessage">[commit short message]</div></td>\r
-                       <td class="rightAlign"><div wicket:id="commitRefs">[commit refs]</div></td>\r
-                       <td class="rightAlign"><span wicket:id="commitLinks">[commit links]</span></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
-       <div class="pager" wicket:id="shortlogMore">[more shortlogs]</div>\r
+       <!-- commits -->\r
+       <div wicket:id="commitsPanel">[commits panel]</div>     \r
 \r
-       <!-- Open Branches Body -->\r
+       <!-- branches -->\r
        <div style="width:400px; float:left;">\r
-               <!-- heads -->\r
-               <div class="header" wicket:id="branches">[branches header]</div>        \r
-               <table style="width:100%" class="pretty">\r
-                       <tbody>\r
-                               <tr wicket:id="branch">\r
-                                       <td class="date"><span wicket:id="branchDate">[branch date]</span></td>\r
-                                       <td><div wicket:id="branchName">[branch name]</div></td>\r
-                                       <td class="rightAlign"><span wicket:id="branchLinks">[branch links]</span></td>\r
-                               </tr>\r
-                       </tbody>\r
-               </table>\r
-               <div class="pager" wicket:id="allBranches">[all branches]</div>\r
-               <!-- Close Branches Body -->\r
+               <div wicket:id="branchesPanel">[branches panel]</div>\r
        </div>\r
 \r
-       <!-- Open Tags body -->\r
+       <!-- tags -->\r
        <div style="margin-left:405px;">\r
-               <!-- tags -->\r
-               <div class="header" wicket:id="tags">[tags header]</div>        \r
-                       <table style="width:100%" class="pretty">\r
-                               <tbody>\r
-                                       <tr wicket:id="tag">\r
-                                       <td class="date"><span wicket:id="tagDate">[tag date]</span></td>\r
-                                       <td><b><div wicket:id="tagName">[tag name]</div></b></td>\r
-                                       <td><div wicket:id="tagDescription">[tag description]</div></td>\r
-                                       <td class="rightAlign"><span wicket:id="tagLinks">[tag links]</span></td>\r
-                                       </tr>\r
-                       </tbody>\r
-                       </table>\r
-               <div class="pager" wicket:id="allTags">[all tags]</div> \r
-       <!-- Close Tags Body -->\r
+               <div wicket:id="tagsPanel">[tags panel]</div>\r
        </div>\r
        \r
 </wicket:extend>       \r
index 0fef375aa7c040c1cdc7186fbdcec9b956ca96fc..72643a763a393a7bcbb7ca41a4281f79e5a47993 100644 (file)
@@ -1,21 +1,12 @@
 package com.gitblit.wicket.pages;\r
 \r
 import java.awt.Dimension;\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.Date;\r
 import java.util.List;\r
-import java.util.Map;\r
 \r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.image.ContextImage;\r
-import org.apache.wicket.markup.repeater.Item;\r
-import org.apache.wicket.markup.repeater.data.DataView;\r
-import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.eclipse.jgit.lib.ObjectId;\r
 import org.eclipse.jgit.lib.Repository;\r
-import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.codecommit.wicket.AbstractChartData;\r
 import com.codecommit.wicket.Chart;\r
@@ -28,16 +19,11 @@ import com.gitblit.StoredSettings;
 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.RepositoryPage;\r
-import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.Metric;\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.panels.AnnotatedTagLinksPanel;\r
-import com.gitblit.wicket.panels.BranchLinksPanel;\r
-import com.gitblit.wicket.panels.RefsPanel;\r
-import com.gitblit.wicket.panels.ShortLogLinksPanel;\r
-import com.gitblit.wicket.panels.TagLinksPanel;\r
+import com.gitblit.wicket.panels.BranchesPanel;\r
+import com.gitblit.wicket.panels.LogPanel;\r
+import com.gitblit.wicket.panels.TagsPanel;\r
 \r
 public class SummaryPage extends RepositoryPage {\r
 \r
@@ -57,8 +43,7 @@ public class SummaryPage extends RepositoryPage {
                        numberRefs = numRefsDef;\r
                }\r
                \r
-               Repository r = getRepository();\r
-               final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
+               Repository r = getRepository();         \r
 \r
                String owner = JGitUtils.getRepositoryOwner(r);\r
                GitBlitWebSession session = GitBlitWebSession.get();\r
@@ -71,120 +56,9 @@ public class SummaryPage extends RepositoryPage {
                add(new Label("repositoryLastChange", lastchange));\r
                add(new Label("repositoryCloneUrl", cloneurl));\r
 \r
-               // shortlog\r
-               add(new LinkPanel("shortlog", "title", getString("gb.shortlog"), ShortLogPage.class, newRepositoryParameter()));\r
-\r
-               List<RevCommit> commits = JGitUtils.getRevLog(r, numberCommits);\r
-               ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
-               DataView<RevCommit> shortlogView = new DataView<RevCommit>("commit", dp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RevCommit> item) {\r
-                               RevCommit entry = item.getModelObject();\r
-                               Date date = JGitUtils.getCommitDate(entry);\r
-\r
-                               item.add(createShortlogDateLabel("commitDate", date));\r
-\r
-                               String author = entry.getAuthorIdent().getName();\r
-                               item.add(createAuthorLabel("commitAuthor", author));\r
-\r
-                               String shortMessage = entry.getShortMessage();\r
-                               String trimmedMessage = trimShortLog(shortMessage);\r
-                               LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, newCommitParameter(entry.getName()));\r
-                               if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
-                               }\r
-                               item.add(shortlog);\r
-\r
-                               item.add(new RefsPanel("commitRefs", entry, allRefs));\r
-\r
-                               item.add(new ShortLogLinksPanel("commitLinks", repositoryName, entry.getName()));\r
-\r
-                               setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(shortlogView);\r
-               if (commits.size() < numberCommits) {\r
-                       add(new Label("shortlogMore", "").setVisible(false));\r
-               } else {\r
-                       add(new LinkPanel("shortlogMore", "link", getString("gb.more") + "...", ShortLogPage.class, newRepositoryParameter()));\r
-               }\r
-\r
-               // tags\r
-               List<RefModel> tags = JGitUtils.getTags(r, numberRefs);\r
-               add(new LinkPanel("tags", "title", getString("gb.tags"), TagsPage.class, newRepositoryParameter()));\r
-\r
-               ListDataProvider<RefModel> tagsDp = new ListDataProvider<RefModel>(tags);\r
-               DataView<RefModel> tagView = new DataView<RefModel>("tag", tagsDp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RefModel> item) {\r
-                               final RefModel entry = item.getModelObject();\r
-\r
-                               item.add(createDateLabel("tagDate", entry.getDate()));\r
-\r
-                               item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getCommitId().getName())));\r
-\r
-                               if (entry.isAnnotatedTag()) {\r
-                                       // annotated tag\r
-                                       item.add(new LinkPanel("tagDescription", "list subject", entry.getShortLog(), TagPage.class, newCommitParameter(entry.getObjectId().getName())));\r
-                                       item.add(new AnnotatedTagLinksPanel("tagLinks", repositoryName, entry));\r
-                               } else {\r
-                                       // simple tag on commit object\r
-                                       item.add(new Label("tagDescription", ""));\r
-                                       item.add(new TagLinksPanel("tagLinks", repositoryName, entry));\r
-                               }\r
-\r
-                               setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(tagView);\r
-               if (tags.size() < numberRefs) {\r
-                       add(new Label("allTags", "").setVisible(false));\r
-               } else {\r
-                       add(new LinkPanel("allTags", "link", getString("gb.allTags") + "...", TagsPage.class, newRepositoryParameter()));\r
-               }\r
-\r
-               // branches\r
-               List<RefModel> branches = new ArrayList<RefModel>();\r
-               branches.addAll(JGitUtils.getLocalBranches(r, numberRefs));\r
-               branches.addAll(JGitUtils.getRemoteBranches(r, numberRefs));\r
-               Collections.sort(branches);\r
-               Collections.reverse(branches);\r
-               if (numberRefs > 0 && branches.size() > numberRefs) {\r
-                       branches = new ArrayList<RefModel>(branches.subList(0, numberRefs));\r
-               }\r
-\r
-               add(new LinkPanel("branches", "title", getString("gb.branches"), BranchesPage.class, newRepositoryParameter()));\r
-\r
-               ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);\r
-               DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RefModel> item) {\r
-                               final RefModel entry = item.getModelObject();\r
-\r
-                               item.add(createDateLabel("branchDate", entry.getDate()));\r
-\r
-                               item.add(new LinkPanel("branchName", "list name", trimString(entry.getDisplayName(), 28), ShortLogPage.class, newCommitParameter(entry.getName())));\r
-\r
-                               item.add(new BranchLinksPanel("branchLinks", repositoryName, entry));\r
-\r
-                               setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(branchesView);\r
-               if (branches.size() < numberRefs) {\r
-                       add(new Label("allBranches", "").setVisible(false));\r
-               } else {\r
-                       add(new LinkPanel("allBranches", "link", getString("gb.allBranches") + "...", BranchesPage.class, newRepositoryParameter()));\r
-               }\r
+               add(new LogPanel("commitsPanel", repositoryName, r, numberCommits, false));\r
+               add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));\r
+               add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));\r
                \r
                // Display an activity line graph\r
                insertActivityGraph(r);\r
index f2bce4972d585f4a416738e148081de6b37ee10a..3a49a745ed1dcf4c6637670af73a489ae18698e2 100644 (file)
        <!-- page nav links --> \r
        <div wicket:id="pageLinks">[page links]</div>\r
 \r
-       <!-- shortlog -->       \r
-       <div style="margin-top:5px;" class="header" wicket:id="summary">[header]</div>  \r
-       <table class="pretty">\r
-               <tbody>\r
-                       <tr wicket:id="tag">\r
-                       <td class="date"><span wicket:id="tagDate">[tag date]</span></td>\r
-                       <td><b><div wicket:id="tagName">[tag name]</div></b></td>\r
-                       <td><div wicket:id="tagDescription">[tag description]</div></td>\r
-                       <td class="rightAlign"><span wicket:id="tagLinks">[tag links]</span></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
+       <!-- tags panel -->\r
+       <div style="margin-top:5px;" wicket:id="tagsPanel">[tags panel]</div>\r
        \r
 </wicket:extend>       \r
 </body>\r
index 2f5b029579e5a18383a25a77532d94a66dce0214..eb1742d1b67b945c168d6b686aae137d92bc7c5a 100644 (file)
@@ -1,58 +1,18 @@
 package com.gitblit.wicket.pages;\r
 \r
-import java.util.List;\r
-\r
 import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.repeater.Item;\r
-import org.apache.wicket.markup.repeater.data.DataView;\r
-import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.eclipse.jgit.lib.Repository;\r
 \r
-import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.RepositoryPage;\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.panels.AnnotatedTagLinksPanel;\r
-import com.gitblit.wicket.panels.TagLinksPanel;\r
+import com.gitblit.wicket.panels.TagsPanel;\r
 \r
 \r
 public class TagsPage extends RepositoryPage {\r
 \r
        public TagsPage(PageParameters params) {\r
                super(params);\r
-               Repository r = getRepository();\r
-               List<RefModel> tags = JGitUtils.getTags(r, -1);\r
-\r
-               // shortlog\r
-               add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
-\r
-               ListDataProvider<RefModel> tagsDp = new ListDataProvider<RefModel>(tags);\r
-               DataView<RefModel> tagView = new DataView<RefModel>("tag", tagsDp) {\r
-                       private static final long serialVersionUID = 1L;\r
-                       int counter = 0;\r
-\r
-                       public void populateItem(final Item<RefModel> item) {\r
-                               final RefModel entry = item.getModelObject();\r
-                               item.add(createDateLabel("tagDate", entry.getDate()));\r
-\r
-                               item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getObjectId().getName())));\r
-\r
-                               if (entry.isAnnotatedTag()) {\r
-                                       // annotated tag\r
-                                       item.add(new LinkPanel("tagDescription", "list subject", entry.getShortLog(), TagPage.class, newCommitParameter(entry.getObjectId().getName())));\r
-                                       item.add(new AnnotatedTagLinksPanel("tagLinks", repositoryName, entry));\r
-                               } else {\r
-                                       // simple tag on commit object\r
-                                       item.add(new Label("tagDescription", ""));\r
-                                       item.add(new TagLinksPanel("tagLinks", repositoryName, entry));\r
-                               }\r
-\r
-                               setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(tagView);\r
+               \r
+               add(new TagsPanel("tagsPanel", repositoryName, getRepository(), -1));\r
+               \r
        }\r
        \r
        @Override\r
index 262257e83ff3e2abde4bc62da0a28e4a7ff3b0ab..e339232f5a434f09b590832b62773bee56ee71e4 100644 (file)
@@ -11,7 +11,7 @@
        <div wicket:id="pageLinks">[page links]</div>\r
 \r
        <!-- header --> \r
-       <div style="margin-top:5px;" class="header" wicket:id="summary">[header]</div>\r
+       <div style="margin-top:5px;" class="header" wicket:id="header">[header]</div>\r
        \r
        <!-- tickets -->        \r
        <table style="width:100%" class="pretty">\r
index 001002c35546af3ec7660867c98181d9011ccdb7..2cfb772321e62c5da3a0920ad4f79eee775dfd4f 100644 (file)
@@ -7,10 +7,10 @@ import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
-import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.utils.TicGitTicket;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.WicketUtils;\r
@@ -20,11 +20,10 @@ public class TicGitPage extends RepositoryPage {
        public TicGitPage(PageParameters params) {\r
                super(params);\r
 \r
-               Repository r = getRepository();\r
-               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(r);\r
+               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(getRepository());\r
 \r
-               // shortlog\r
-               add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
+               // header\r
+               add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
 \r
                ListDataProvider<TicGitTicket> ticketsDp = new ListDataProvider<TicGitTicket>(tickets);\r
                DataView<TicGitTicket> ticketsView = new DataView<TicGitTicket>("ticket", ticketsDp) {\r
@@ -36,11 +35,11 @@ public class TicGitPage extends RepositoryPage {
                                Label stateLabel = new Label("ticketState", entry.state);\r
                                WicketUtils.setTicketCssClass(stateLabel, entry.state);\r
                                item.add(stateLabel);\r
-                               item.add(createDateLabel("ticketDate", entry.date));\r
-                               item.add(new Label("ticketHandler", trimString(entry.handler, 30)));\r
-                               item.add(new LinkPanel("ticketTitle", null, trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name)));\r
+                               item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
+                               item.add(new Label("ticketHandler", WicketUtils.trimString(entry.handler, 30)));\r
+                               item.add(new LinkPanel("ticketTitle", null, WicketUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name)));\r
 \r
-                               setAlternatingBackground(item, counter);\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
                };\r
index 5b39268f8bd7fb88c910f7c04ec300e911836a76..47fa87be224635211ff2c3e39a0a100391112d3a 100644 (file)
@@ -30,7 +30,7 @@
                <tbody>\r
                        <tr wicket:id="comment">\r
                        <td class="date"><span wicket:id="commentDate">[comment date]</span></td>\r
-                       <td><b><div wicket:id="commentAuthor">[comment author]</div></b></td>\r
+                       <td class="author"><span wicket:id="commentAuthor">[comment author]</span></td>\r
                        <td><div wicket:id="commentText">[comment text]</div></td>\r
                        </tr>\r
                </tbody>\r
index 06a7a5ac6391dda8a7308e163d893b13d1dff277..5d3ceb48090c2645a7c60b770933e4596710594d 100644 (file)
@@ -41,10 +41,10 @@ public class TicGitTicketPage extends RepositoryPage {
 \r
                        public void populateItem(final Item<Comment> item) {\r
                                final Comment entry = item.getModelObject();\r
-                               item.add(createDateLabel("commentDate", entry.date));\r
+                               item.add(WicketUtils.createDateLabel("commentDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
                                item.add(new Label("commentAuthor", entry.author));\r
                                item.add(new Label("commentText", prepareComment(entry.text)).setEscapeModelStrings(false));\r
-                               setAlternatingBackground(item, counter);\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
                };\r
index 628036fbc03250e0f63b5b719a643db069d08440..3199447a447a68438cc0756562d14bcefb445043 100644 (file)
@@ -1,10 +1,11 @@
 package com.gitblit.wicket.panels;\r
 \r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.panel.Panel;\r
 \r
 import com.gitblit.wicket.pages.RepositoriesPage;\r
 \r
-public class AdminLinksPanel extends BasePanel {\r
+public class AdminLinksPanel extends Panel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
diff --git a/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html
deleted file mode 100644 (file)
index 1bedc69..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<wicket:panel>\r
-       <div class="link">\r
-               <a wicket:id="tag"><wicket:message key="gb.tag"></wicket:message></a> | <a wicket:id="commit"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="shortlog"><wicket:message key="gb.shortlog"></wicket:message></a>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java
deleted file mode 100644 (file)
index 3a494df..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.pages.CommitPage;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
-import com.gitblit.wicket.pages.TagPage;\r
-\r
-\r
-public class AnnotatedTagLinksPanel extends BasePanel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public AnnotatedTagLinksPanel(String id, String repositoryName, RefModel tag) {\r
-               super(id);\r
-               add(new BookmarkablePageLink<Void>("tag", TagPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getObjectId().getName())));\r
-               add(new BookmarkablePageLink<Void>("commit", CommitPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getCommitId().getName())));\r
-               add(new BookmarkablePageLink<Void>("shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
-       }\r
-}
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/BasePanel.java b/src/com/gitblit/wicket/panels/BasePanel.java
deleted file mode 100644 (file)
index 48f5218..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.markup.html.panel.Panel;\r
-import org.apache.wicket.model.StringResourceModel;\r
-\r
-public abstract class BasePanel extends Panel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public BasePanel(String id) {\r
-               super(id);\r
-       }\r
-       \r
-       public StringResourceModel stringModel(String key) {\r
-               return new StringResourceModel(key, this, null);\r
-       }\r
-}\r
diff --git a/src/com/gitblit/wicket/panels/BranchLinksPanel.html b/src/com/gitblit/wicket/panels/BranchLinksPanel.html
deleted file mode 100644 (file)
index 3e51948..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<wicket:panel>\r
-       <div class="link">\r
-               <a wicket:id="shortlog"><wicket:message key="gb.shortlog"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/BranchLinksPanel.java b/src/com/gitblit/wicket/panels/BranchLinksPanel.java
deleted file mode 100644 (file)
index ccc8f4e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
-import com.gitblit.wicket.pages.TreePage;\r
-\r
-public class BranchLinksPanel extends BasePanel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public BranchLinksPanel(String id, String repositoryName, RefModel tag) {\r
-               super(id);\r
-               add(new BookmarkablePageLink<Void>("shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
-               add(new BookmarkablePageLink<Void>("tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
-       }\r
-}
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.html b/src/com/gitblit/wicket/panels/BranchesPanel.html
new file mode 100644 (file)
index 0000000..50a1681
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml"  \r
+      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
+      xml:lang="en"  \r
+      lang="en"> \r
+\r
+<body>\r
+<wicket:panel>\r
+\r
+       <!-- header -->\r
+       <div class="header" wicket:id="branches">[branches header]</div>        \r
+       \r
+       <table style="width:100%;" class="pretty">\r
+               <tbody>\r
+                       <tr wicket:id="branch">\r
+                       <td class="date"><span wicket:id="branchDate">[branch date]</span></td>\r
+                       <td><span wicket:id="branchName">[branch name]</span></td>\r
+                       <td><span wicket:id="branchType">[branch type]</span></td>\r
+                       <td class="rightAlign">\r
+                               <div class="link">\r
+                                               <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
+                                       </div>  \r
+                               </td>\r
+                       </tr>\r
+       </tbody>\r
+       </table>        \r
+\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
diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.java b/src/com/gitblit/wicket/panels/BranchesPanel.java
new file mode 100644 (file)
index 0000000..dd4596d
--- /dev/null
@@ -0,0 +1,84 @@
+package com.gitblit.wicket.panels;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.List;\r
+\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.apache.wicket.markup.repeater.Item;\r
+import org.apache.wicket.markup.repeater.data.DataView;\r
+import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
+import org.apache.wicket.model.StringResourceModel;\r
+import org.eclipse.jgit.lib.Constants;\r
+import org.eclipse.jgit.lib.Repository;\r
+\r
+import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.models.RefModel;\r
+import com.gitblit.wicket.pages.BranchesPage;\r
+import com.gitblit.wicket.pages.LogPage;\r
+import com.gitblit.wicket.pages.SummaryPage;\r
+import com.gitblit.wicket.pages.TreePage;\r
+\r
+public class BranchesPanel extends Panel {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public BranchesPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) {\r
+               super(wicketId);\r
+\r
+               // branches\r
+               List<RefModel> branches = new ArrayList<RefModel>();\r
+               branches.addAll(JGitUtils.getLocalBranches(r, maxCount));\r
+               branches.addAll(JGitUtils.getRemoteBranches(r, maxCount));\r
+               Collections.sort(branches);\r
+               Collections.reverse(branches);\r
+               if (maxCount > 0 && branches.size() > maxCount) {\r
+                       branches = new ArrayList<RefModel>(branches.subList(0, maxCount));\r
+               }\r
+\r
+               if (maxCount > 0) {\r
+                       // summary page\r
+                       // show branches page link\r
+                       add(new LinkPanel("branches", "title", new StringResourceModel("gb.branches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               } else {\r
+                       // branches page\r
+                       // show repository summary page link\r
+                       add(new LinkPanel("branches", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               }\r
+               \r
+               ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);\r
+               DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<RefModel> item) {\r
+                               final RefModel entry = item.getModelObject();\r
+\r
+                               item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
+\r
+                               item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+                               \r
+                               // only show branch type on the branches page\r
+                               boolean remote = entry.getName().startsWith(Constants.R_REMOTES);\r
+                               item.add(new Label("branchType", remote ? getString("gb.remote"):getString("gb.local")).setVisible(maxCount <= 0));\r
+                               \r
+                               item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(branchesView);\r
+               if (branches.size() < maxCount || maxCount <= 0) {\r
+                       add(new Label("allBranches", "").setVisible(false));\r
+               } else {\r
+                       add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               }\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/panels/LogPanel.html b/src/com/gitblit/wicket/panels/LogPanel.html
new file mode 100644 (file)
index 0000000..e342f00
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml"  \r
+      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
+      xml:lang="en"  \r
+      lang="en"> \r
+\r
+<body>\r
+<wicket:panel>\r
+\r
+       <!-- header --> \r
+       <div class="header" wicket:id="header">[log header]</div>\r
+               \r
+       <table style="width:100%" class="pretty">\r
+               <tbody>\r
+                       <tr wicket:id="commit">\r
+                       <td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
+                       <td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
+                       <td><div wicket:id="commitShortMessage">[commit short message]</div></td>\r
+                       <td class="rightAlign"><div wicket:id="commitRefs">[commit refs]</div></td>                     \r
+                       <td class="rightAlign"><div class="link">\r
+                                       <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
+                                       </div>\r
+                               </td>\r
+                       </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
diff --git a/src/com/gitblit/wicket/panels/LogPanel.java b/src/com/gitblit/wicket/panels/LogPanel.java
new file mode 100644 (file)
index 0000000..630be61
--- /dev/null
@@ -0,0 +1,118 @@
+package com.gitblit.wicket.panels;\r
+\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.Map;\r
+\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.navigation.paging.PagingNavigator;\r
+import org.apache.wicket.markup.html.panel.Panel;\r
+import org.apache.wicket.markup.repeater.Item;\r
+import org.apache.wicket.markup.repeater.data.DataView;\r
+import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
+import org.apache.wicket.model.StringResourceModel;\r
+import org.eclipse.jgit.lib.ObjectId;\r
+import org.eclipse.jgit.lib.Repository;\r
+import org.eclipse.jgit.revwalk.RevCommit;\r
+\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
+import com.gitblit.wicket.pages.CommitPage;\r
+import com.gitblit.wicket.pages.DiffPage;\r
+import com.gitblit.wicket.pages.LogPage;\r
+import com.gitblit.wicket.pages.SummaryPage;\r
+import com.gitblit.wicket.pages.TreePage;\r
+\r
+public class LogPanel extends Panel {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public LogPanel(String wicketId, final String repositoryName, Repository r, int maxCount, boolean showPager) {\r
+               super(wicketId);\r
+\r
+               final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
+               List<RevCommit> commits = JGitUtils.getRevLog(r, maxCount);\r
+\r
+               // header\r
+               if (showPager) {\r
+                       // shortlog page\r
+                       // show repository summary page link\r
+                       add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, 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), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               }\r
+\r
+               ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
+               DataView<RevCommit> logView = new DataView<RevCommit>("commit", dp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<RevCommit> item) {\r
+                               final RevCommit entry = item.getModelObject();\r
+                               final Date date = JGitUtils.getCommitDate(entry);\r
+\r
+                               item.add(WicketUtils.createDateLabel("commitDate", date, GitBlitWebSession.get().getTimezone()));\r
+\r
+                               String author = entry.getAuthorIdent().getName();\r
+                               item.add(WicketUtils.createAuthorLabel("commitAuthor", author));\r
+\r
+                               String shortMessage = entry.getShortMessage();\r
+                               String trimmedMessage = WicketUtils.trimShortLog(shortMessage);\r
+                               LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName()));\r
+                               if (!shortMessage.equals(trimmedMessage)) {\r
+                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+                               }\r
+                               item.add(shortlog);\r
+\r
+                               item.add(new RefsPanel("commitRefs", entry, allRefs));\r
+\r
+                               item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(logView);\r
+\r
+               // determine to show pager, more, or neither\r
+               if (maxCount <= 0) {\r
+                       // no display limit\r
+                       add(new Label("moreLogs", "").setVisible(false));\r
+                       add(new Label("pageLogs", "").setVisible(false));\r
+               } else {\r
+                       if (commits.size() == maxCount) {\r
+\r
+                       }\r
+                       if (showPager) {\r
+                               // paging\r
+                               add(new Label("moreLogs", "").setVisible(false));\r
+                               if (commits.size() == maxCount) {\r
+                                       // show pager\r
+                                       logView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT);\r
+                                       add(new PagingNavigator("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() == maxCount) {\r
+                                       // show more\r
+                                       add(new LinkPanel("moreLogs", "link", new StringResourceModel("gb.moreLogs", this, null), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                               } else {\r
+                                       // no more\r
+                                       add(new Label("moreLogs", "").setVisible(false));\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+}\r
index db82728191f077bc58671bca2deec924814aeb61..f2e4d316faaedb8cef536b415036a0e3e8aa7efe 100644 (file)
@@ -7,7 +7,7 @@
 <wicket:panel>\r
        <!-- page nav links --> \r
        <div class="page_nav">\r
-               <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="shortlog"><wicket:message key="gb.shortlog"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>\r
+               <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>\r
        </div>  \r
 </wicket:panel>\r
 </html>
\ No newline at end of file
index d9c25275f53d760c0d02d9b56db1d474e5b6c8d9..9c6298c0d3f0fca6940d9094ac9bd1227672c338 100644 (file)
@@ -6,9 +6,9 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.apache.wicket.Component;\r
-import org.apache.wicket.PageParameters;\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.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
@@ -16,14 +16,15 @@ import org.eclipse.jgit.lib.Repository;
 \r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.BranchesPage;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
+import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TagsPage;\r
 import com.gitblit.wicket.pages.TicGitPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
-public class PageLinksPanel extends BasePanel {\r
+public class PageLinksPanel extends Panel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
@@ -33,7 +34,7 @@ public class PageLinksPanel extends BasePanel {
 \r
                {\r
                        put("summary", "gb.summary");\r
-                       put("shortlog", "gb.shortlog");\r
+                       put("log", "gb.log");\r
                        put("branches", "gb.branches");\r
                        put("tags", "gb.tags");\r
                        put("tree", "gb.tree");\r
@@ -45,11 +46,11 @@ public class PageLinksPanel extends BasePanel {
                super(id);\r
 \r
                // summary\r
-               add(new BookmarkablePageLink<Void>("summary", SummaryPage.class, new PageParameters("p=" + repositoryName)));\r
-               add(new BookmarkablePageLink<Void>("shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName)));\r
-               add(new BookmarkablePageLink<Void>("branches", BranchesPage.class, new PageParameters("p=" + repositoryName)));\r
-               add(new BookmarkablePageLink<Void>("tags", TagsPage.class, new PageParameters("p=" + repositoryName)));\r
-               add(new BookmarkablePageLink<Void>("tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=HEAD")));\r
+               add(new BookmarkablePageLink<Void>("summary", SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               add(new BookmarkablePageLink<Void>("branches", BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
 \r
                // Add dynamic repository extras\r
                List<String> extras = new ArrayList<String>();\r
@@ -65,7 +66,7 @@ public class PageLinksPanel extends BasePanel {
                                String extra = item.getModelObject();\r
                                if (extra.equals("ticgit")) {\r
                                        item.add(new Label("extraSeparator", " | "));\r
-                                       item.add(new LinkPanel("extraLink", null, "ticgit", TicGitPage.class, new PageParameters("p=" + repositoryName)));\r
+                                       item.add(new LinkPanel("extraLink", null, "ticgit", TicGitPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                                }\r
                        }\r
                };\r
@@ -77,8 +78,10 @@ public class PageLinksPanel extends BasePanel {
                        String key = knownPages.get(wicketId);\r
                        String linkName = getString(key);\r
                        if (linkName.equals(pageName)) {\r
-                               Component c = get(wicketId);\r
-                               c.setEnabled(false);\r
+                               Component c = get(wicketId);                            \r
+                               if (c != null) {\r
+                                       c.setEnabled(false);\r
+                               }\r
                                break;\r
                        }\r
                }\r
index a8a5c2859b7248a02d63d3307fbc54ebd04fd0bf..d27133ce45d7824c19b48408aac176f9b0b4dc18 100644 (file)
@@ -4,7 +4,6 @@ import java.io.Serializable;
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
-import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.panel.Panel;\r
 import org.apache.wicket.markup.repeater.Item;\r
@@ -12,6 +11,7 @@ import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
 \r
 import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 public class PathBreadcrumbsPanel extends Panel {\r
@@ -49,7 +49,7 @@ public class PathBreadcrumbsPanel extends Panel {
                                        parameters += ",f=" + path;\r
                                }\r
 \r
-                               item.add(new LinkPanel("pathLink", null, entry.name, TreePage.class, new PageParameters(parameters)));\r
+                               item.add(new LinkPanel("pathLink", null, entry.name, TreePage.class, WicketUtils.newPathParameter(repositoryName, commitId, path)));\r
                                item.add(new Label("pathSeparator", entry.isLeaf ? "" : "/"));\r
                        }\r
                };\r
diff --git a/src/com/gitblit/wicket/panels/PathLinksPanel.html b/src/com/gitblit/wicket/panels/PathLinksPanel.html
deleted file mode 100644 (file)
index 8079ecc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<wicket:panel>\r
-       <div class="link">\r
-               <a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/PathLinksPanel.java b/src/com/gitblit/wicket/panels/PathLinksPanel.java
deleted file mode 100644 (file)
index e1c489f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-\r
-import com.gitblit.wicket.models.PathModel;\r
-import com.gitblit.wicket.pages.BlobPage;\r
-import com.gitblit.wicket.pages.DiffPage;\r
-\r
-\r
-public class PathLinksPanel extends BasePanel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public PathLinksPanel(String id, String repositoryName, PathModel path) {\r
-               super(id);\r
-               add(new BookmarkablePageLink<Void>("diff", DiffPage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));\r
-               add(new BookmarkablePageLink<Void>("view", BlobPage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));\r
-               add(new BookmarkablePageLink<Void>("history", BlobPage.class, new PageParameters()).setEnabled(false));\r
-       }\r
-}
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/ShortLogLinksPanel.html b/src/com/gitblit/wicket/panels/ShortLogLinksPanel.html
deleted file mode 100644 (file)
index 2208ceb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<wicket:panel>\r
-       <div class="link">\r
-               <a wicket:id="commit"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="commitdiff"><wicket:message key="gb.commitdiff"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/ShortLogLinksPanel.java b/src/com/gitblit/wicket/panels/ShortLogLinksPanel.java
deleted file mode 100644 (file)
index bf2c772..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-\r
-import com.gitblit.wicket.pages.CommitPage;\r
-import com.gitblit.wicket.pages.DiffPage;\r
-import com.gitblit.wicket.pages.TreePage;\r
-\r
-\r
-public class ShortLogLinksPanel extends BasePanel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public ShortLogLinksPanel(String id, String repositoryName, String commitId) {\r
-               super(id);\r
-\r
-               add(new BookmarkablePageLink<Void>("commit", CommitPage.class, new PageParameters("p=" + repositoryName + ",h=" + commitId)));\r
-               add(new BookmarkablePageLink<Void>("commitdiff", DiffPage.class, new PageParameters("p=" + repositoryName + ",h=" + commitId)));\r
-               add(new BookmarkablePageLink<Void>("tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=" + commitId)));\r
-       }\r
-}
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/TagLinksPanel.html b/src/com/gitblit/wicket/panels/TagLinksPanel.html
deleted file mode 100644 (file)
index 34a39c9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml"  \r
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
-      xml:lang="en"  \r
-      lang="en"> \r
-\r
-<wicket:panel>\r
-       <div class="link">\r
-               <a wicket:id="commit"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="shortlog"><wicket:message key="gb.shortlog"></wicket:message></a>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/TagLinksPanel.java b/src/com/gitblit/wicket/panels/TagLinksPanel.java
deleted file mode 100644 (file)
index e7f7c8d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.pages.CommitPage;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
-\r
-\r
-public class TagLinksPanel extends BasePanel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public TagLinksPanel(String id, String repositoryName, RefModel tag) {\r
-               super(id);\r
-               add(new BookmarkablePageLink<Void>("commit", CommitPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getCommitId().getName())));\r
-               add(new BookmarkablePageLink<Void>("shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
-       }\r
-}
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/TagsPanel.html b/src/com/gitblit/wicket/panels/TagsPanel.html
new file mode 100644 (file)
index 0000000..599412d
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml"  \r
+      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  \r
+      xml:lang="en"  \r
+      lang="en"> \r
+\r
+<body>\r
+<wicket:panel>\r
+\r
+       <!-- tags -->\r
+       <div class="header" wicket:id="header">[tags header]</div>      \r
+       <table style="width:100%" class="pretty">\r
+               <tbody>\r
+               <tr wicket:id="tag">\r
+                       <td class="date"><span wicket:id="tagDate">[tag date]</span></td>\r
+                       <td><b><span wicket:id="tagName">[tag name]</span></b></td>\r
+                       <td><span wicket:id="tagDescription">[tag description]</span></td>\r
+                       <td class="rightAlign">\r
+                               <div class="link">\r
+                                               <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="commit"><wicket:message key="gb.commit"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a>\r
+                                       </div>\r
+                               </td>\r
+               </tr>\r
+       </tbody>\r
+       </table>\r
+       \r
+       <div wicket:id="allTags">[all tags]</div>       \r
+               \r
+       <!-- spacer -->\r
+       <div style="padding:5px;"></div>\r
+</wicket:panel>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/TagsPanel.java b/src/com/gitblit/wicket/panels/TagsPanel.java
new file mode 100644 (file)
index 0000000..92307b4
--- /dev/null
@@ -0,0 +1,81 @@
+package com.gitblit.wicket.panels;\r
+\r
+import java.util.List;\r
+\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.apache.wicket.markup.repeater.Item;\r
+import org.apache.wicket.markup.repeater.data.DataView;\r
+import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
+import org.apache.wicket.model.StringResourceModel;\r
+import org.eclipse.jgit.lib.Repository;\r
+\r
+import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.models.RefModel;\r
+import com.gitblit.wicket.pages.CommitPage;\r
+import com.gitblit.wicket.pages.LogPage;\r
+import com.gitblit.wicket.pages.SummaryPage;\r
+import com.gitblit.wicket.pages.TagPage;\r
+import com.gitblit.wicket.pages.TagsPage;\r
+\r
+public class TagsPanel extends Panel {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public TagsPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) {\r
+               super(wicketId);\r
+\r
+               // header\r
+               List<RefModel> tags = JGitUtils.getTags(r, maxCount);\r
+               if (maxCount > 0) {\r
+                       // summary page\r
+                       // show tags page link\r
+                       add(new LinkPanel("header", "title", new StringResourceModel("gb.tags", this, null), TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               } else {\r
+                       // tags page\r
+                       // show repository summary page link\r
+                       add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               }\r
+\r
+               ListDataProvider<RefModel> tagsDp = new ListDataProvider<RefModel>(tags);\r
+               DataView<RefModel> tagView = new DataView<RefModel>("tag", tagsDp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<RefModel> item) {\r
+                               RefModel entry = item.getModelObject();\r
+\r
+                               item.add(WicketUtils.createDateLabel("tagDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
+\r
+                               item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getCommitId().getName())));\r
+                               String message;\r
+                               if (maxCount > 0) {\r
+                                       message = WicketUtils.trimString(entry.getShortLog(), 40);\r
+                               } else {\r
+                                       message = entry.getShortLog();\r
+                               }\r
+                               if (entry.isAnnotatedTag()) {\r
+                                       item.add(new LinkPanel("tagDescription", "list subject", message, TagPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())));\r
+                               } else {\r
+                                       item.add(new LinkPanel("tagDescription", "list subject", message, CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())));\r
+                               }\r
+                               item.add(new BookmarkablePageLink<Void>("view", TagPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())).setEnabled(entry.isAnnotatedTag()));\r
+                               item.add(new BookmarkablePageLink<Void>("commit", CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getCommitId().getName())));\r
+                               item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(tagView);\r
+               if (tags.size() < maxCount || maxCount <= 0) {\r
+                       add(new Label("allTags", "").setVisible(false));\r
+               } else {\r
+                       add(new LinkPanel("allTags", "link", new StringResourceModel("gb.allTags", this, null), TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+               }\r
+       }\r
+}\r
index c8277ae0d311f0d1b8ad9d6359e470cfc0a002ee..e1e6f7953abe29bdd386e806fbca52dccc83e96c 100644 (file)
@@ -1,20 +1,21 @@
 package com.gitblit.wicket.panels;\r
 \r
-import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.panel.Panel;\r
 \r
+import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.pages.BlobPage;\r
 \r
 \r
-public class TreeBlobLinksPanel extends BasePanel {\r
+public class TreeBlobLinksPanel extends Panel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
        public TreeBlobLinksPanel(String id, String repositoryName, PathModel path) {\r
                super(id);\r
-               add(new BookmarkablePageLink<Void>("view", BlobPage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));\r
-               add(new BookmarkablePageLink<Void>("raw", BlobPage.class, new PageParameters()).setEnabled(false));\r
-               add(new BookmarkablePageLink<Void>("history", BlobPage.class, new PageParameters()).setEnabled(false));\r
+               add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, path.commitId, path.path)));\r
+               add(new BookmarkablePageLink<Void>("raw", BlobPage.class).setEnabled(false));\r
+               add(new BookmarkablePageLink<Void>("history", BlobPage.class).setEnabled(false));\r
        }\r
 }
\ No newline at end of file
index 9a42943cd4a19d0d26c0db6ac4f8e30436ccbbd1..4965004a64ecb8ae82188226f3da567dec863660 100644 (file)
@@ -1,19 +1,20 @@
 package com.gitblit.wicket.panels;\r
 \r
-import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.panel.Panel;\r
 \r
+import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 \r
-public class TreeLinksPanel extends BasePanel {\r
+public class TreeLinksPanel extends Panel {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
        public TreeLinksPanel(String id, String repositoryName, PathModel path) {\r
                super(id);\r
-               add(new BookmarkablePageLink<Void>("tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));\r
-               add(new BookmarkablePageLink<Void>("history", TreePage.class, new PageParameters()).setEnabled(false));\r
+               add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newPathParameter(repositoryName, path.commitId, path.path)));\r
+               add(new BookmarkablePageLink<Void>("history", TreePage.class).setEnabled(false));\r
        }\r
 }
\ No newline at end of file
index 6e1717cb3c07b873672717b09ddc6d5d000134fe..42ab2c0c48ff9670b8ea0ad8fdcf8f78842863cb 100644 (file)
@@ -103,6 +103,12 @@ div.link a {
        font-size: inherit;\r
 }\r
 \r
+div.link em, div.link span em {\r
+       font-style: normal;\r
+       font-family: inherit;\r
+       font-size: inherit;\r
+}\r
+\r
 div.page_header {\r
        height: 25px;\r
        padding: 5px;\r
@@ -157,6 +163,10 @@ div.page_nav a:hover {
        text-decoration: underline;\r
 }\r
 \r
+div.page_nav em {\r
+       font-style: normal;\r
+}\r
+\r
 div.page_nav2 {\r
        padding: 2px 5px 7px 5px;       \r
 }\r