]> source.dussan.org Git - gitblit.git/commitdiff
Simplified links some more. Added TicGit browser.
authorJames Moger <james.moger@gitblit.com>
Wed, 6 Apr 2011 02:26:37 +0000 (22:26 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 6 Apr 2011 02:26:37 +0000 (22:26 -0400)
25 files changed:
resources/gitblit.css
src/com/gitblit/tests/JGitUtilsTest.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/utils/TicGitTicket.java [new file with mode: 0644]
src/com/gitblit/wicket/BasePage.java
src/com/gitblit/wicket/GitBlitWebApp.java
src/com/gitblit/wicket/RepositoryPage.java
src/com/gitblit/wicket/models/RefModel.java
src/com/gitblit/wicket/pages/BranchesPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/BranchesPage.java [new file with mode: 0644]
src/com/gitblit/wicket/pages/HeadsPage.html [deleted file]
src/com/gitblit/wicket/pages/HeadsPage.java [deleted file]
src/com/gitblit/wicket/pages/SummaryPage.html
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TagsPage.java
src/com/gitblit/wicket/pages/TicGitPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicGitPage.java [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicGitTicketPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicGitTicketPage.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/BranchLinksPanel.html [new file with mode: 0644]
src/com/gitblit/wicket/panels/BranchLinksPanel.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/HeadLinksPanel.html [deleted file]
src/com/gitblit/wicket/panels/HeadLinksPanel.java [deleted file]
src/com/gitblit/wicket/panels/PageLinksPanel.html
src/com/gitblit/wicket/panels/PageLinksPanel.java

index 032b26ee420c5e403ba2d2bba8081435033af67d..d126a8ae59b27bfa8244d7253edcb350beb6a078 100644 (file)
@@ -175,6 +175,32 @@ div.commit_message {
        border-width: 1px 0px 1px;\r
 }\r
 \r
+div.bug_open {\r
+       padding: 2px;\r
+       background-color: #800000;\r
+       color: white;   \r
+       text-align: center;\r
+}\r
+\r
+div.bug_resolved {\r
+       padding: 2px;\r
+       background-color: #008000;\r
+       color: white;\r
+       text-align: center;\r
+}\r
+\r
+div.bug_invalid {\r
+       padding: 2px;\r
+       background-color: gray;\r
+       text-align: center;\r
+}\r
+\r
+div.bug_hold {\r
+       padding: 2px;\r
+       background-color: orange;\r
+       text-align: center;\r
+}\r
+\r
 a.list {\r
        text-decoration: none;\r
        color: #000000;\r
index c04ceefdbf149a40c20b339952bae29cdd277bea..6c398401ac819c7fb63d41ca382d1dc7ca0ebb40 100644 (file)
@@ -15,6 +15,8 @@ import org.eclipse.jgit.revwalk.RevTree;
 import org.eclipse.jgit.storage.file.FileRepository;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.utils.TicGitTicket;\r
+import com.gitblit.wicket.models.RefModel;\r
 \r
 \r
 public class JGitUtilsTest extends TestCase {\r
@@ -67,5 +69,14 @@ public class JGitUtilsTest extends TestCase {
                r.close();\r
                assertTrue("Content is null!", content != null);\r
        }\r
+       \r
+       public void testTicGit() throws Exception {\r
+               Repository r = new FileRepository(new File(repositoriesFolder, "ticgit") + "/" + Constants.DOT_GIT);\r
+               RefModel ticgit = JGitUtils.getTicGitBranch(r);\r
+               assertTrue("Ticgit branch does not exist!", ticgit != null);\r
+               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(r);\r
+               assertTrue("No tickets found!", tickets.size() > 0);\r
+               r.close();\r
+       }\r
 \r
 }\r
index 0c29eab8a09d814cb32065578cea98ae4af60eb2..b4e0b151cf35b4bd2c87c4bd64a9641ba6069557 100644 (file)
@@ -6,6 +6,7 @@ import java.io.IOException;
 import java.io.InputStream;\r
 import java.io.RandomAccessFile;\r
 import java.text.DateFormat;\r
+import java.text.ParseException;\r
 import java.text.SimpleDateFormat;\r
 import java.util.ArrayList;\r
 import java.util.Collections;\r
@@ -37,6 +38,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
+import com.gitblit.utils.TicGitTicket.Comment;\r
 import com.gitblit.wicket.models.Metric;\r
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.models.RefModel;\r
@@ -333,10 +335,14 @@ public class JGitUtils {
                return getRefs(r, Constants.R_TAGS, maxCount);\r
        }\r
 \r
-       public static List<RefModel> getHeads(Repository r, int maxCount) {\r
+       public static List<RefModel> getLocalBranches(Repository r, int maxCount) {\r
                return getRefs(r, Constants.R_HEADS, maxCount);\r
        }\r
 \r
+       public static List<RefModel> getRemoteBranches(Repository r, int maxCount) {\r
+               return getRefs(r, Constants.R_REMOTES, maxCount);\r
+       }\r
+\r
        public static List<RefModel> getRefs(Repository r, String refs, int maxCount) {\r
                List<RefModel> list = new ArrayList<RefModel>();\r
                try {\r
@@ -448,9 +454,110 @@ public class JGitUtils {
                List<String> keys = new ArrayList<String>(map.keySet());\r
                Collections.sort(keys);\r
                List<Metric> metrics = new ArrayList<Metric>();\r
-               for (String key:keys) {\r
+               for (String key : keys) {\r
                        metrics.add(map.get(key));\r
-               }               \r
+               }\r
                return metrics;\r
        }\r
+\r
+       public static RefModel getTicGitBranch(Repository r) {\r
+               RefModel ticgitBranch = null;\r
+               try {\r
+                       // search for ticgit branch in local heads\r
+                       for (RefModel ref : getLocalBranches(r, -1)) {\r
+                               if (ref.getDisplayName().endsWith("ticgit") || ref.getDisplayName().endsWith("ticgit-ng")) {\r
+                                       ticgitBranch = ref;\r
+                                       break;\r
+                               }\r
+                       }\r
+\r
+                       // search for ticgit branch in remote heads\r
+                       if (ticgitBranch == null) {\r
+                               for (RefModel ref : getRemoteBranches(r, -1)) {\r
+                                       if (ref.getDisplayName().endsWith("ticgit") || ref.getDisplayName().endsWith("ticgit-ng")) {\r
+                                               ticgitBranch = ref;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                       }\r
+               } catch (Throwable t) {\r
+                       LOGGER.error("Failed to find ticgit branch!", t);\r
+               }\r
+               return ticgitBranch;\r
+       }\r
+\r
+       public static List<TicGitTicket> getTicGitTickets(Repository r) {\r
+               RefModel ticgitBranch = getTicGitBranch(r);\r
+               List<PathModel> paths = getFilesInPath(r, null, ticgitBranch.getCommit());\r
+               List<TicGitTicket> tickets = new ArrayList<TicGitTicket>();\r
+               for (PathModel ticketFolder : paths) {\r
+                       if (ticketFolder.isTree()) {\r
+                               try {\r
+                                       TicGitTicket t = new TicGitTicket(ticketFolder.name);\r
+                                       readTicketContents(r, ticgitBranch, t);\r
+                                       tickets.add(t);\r
+                               } catch (Throwable t) {\r
+                                       LOGGER.error("Failed to get a ticgit ticket!", t);\r
+                               }\r
+                       }\r
+               }\r
+               Collections.sort(tickets);\r
+               Collections.reverse(tickets);\r
+               return tickets;\r
+       }\r
+\r
+       public static TicGitTicket getTicGitTicket(Repository r, String ticketFolder) {\r
+               RefModel ticgitBranch = getTicGitBranch(r);\r
+               if (ticgitBranch != null) {\r
+                       try {\r
+                               TicGitTicket ticket = new TicGitTicket(ticketFolder);\r
+                               readTicketContents(r, ticgitBranch, ticket);\r
+                               return ticket;\r
+                       } catch (Throwable t) {\r
+                               LOGGER.error("Failed to get ticgit ticket " + ticketFolder, t);\r
+                       }\r
+               }\r
+               return null;\r
+       }\r
+       \r
+       private static void readTicketContents(Repository r, RefModel ticgitBranch, TicGitTicket ticket) {\r
+               List<PathModel> ticketFiles = getFilesInPath(r, ticket.name, ticgitBranch.getCommit());\r
+               for (PathModel file : ticketFiles) {\r
+                       String content = getRawContentAsString(r, ticgitBranch.getCommit(), file.path).trim();\r
+                       if (file.name.equals("TICKET_ID")) {\r
+                               ticket.id = content;\r
+                       } else if (file.name.equals("TITLE")) {\r
+                               ticket.title = content;\r
+                       } else {\r
+                               String[] chunks = file.name.split("_");\r
+                               if (chunks[0].equals("ASSIGNED")) {\r
+                                       ticket.handler = content;\r
+                               } else if (chunks[0].equals("COMMENT")) {\r
+                                       try {\r
+                                               Comment c = new Comment(file.name, content);\r
+                                               ticket.comments.add(c);\r
+                                       } catch (ParseException e) {\r
+                                               e.printStackTrace();\r
+                                       }\r
+                               } else if (chunks[0].equals("TAG")) {\r
+                                       if (content.startsWith("TAG_")) {\r
+                                               ticket.tags.add(content.substring(4));\r
+                                       } else {\r
+                                               ticket.tags.add(content);\r
+                                       }\r
+                               } else if (chunks[0].equals("STATE")) {\r
+                                       ticket.state = content;\r
+                               }\r
+                       }\r
+               }\r
+               Collections.sort(ticket.comments);\r
+       }\r
+\r
+       public static String getTicGitContent(Repository r, String filePath) {\r
+               RefModel ticgitBranch = getTicGitBranch(r);\r
+               if (ticgitBranch != null) {\r
+                       return getRawContentAsString(r, ticgitBranch.getCommit(), filePath);\r
+               }\r
+               return "";\r
+       }\r
 }\r
diff --git a/src/com/gitblit/utils/TicGitTicket.java b/src/com/gitblit/utils/TicGitTicket.java
new file mode 100644 (file)
index 0000000..48491a6
--- /dev/null
@@ -0,0 +1,77 @@
+package com.gitblit.utils;\r
+\r
+import java.io.Serializable;\r
+import java.text.ParseException;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Date;\r
+import java.util.List;\r
+\r
+import com.gitblit.wicket.models.PathModel;\r
+\r
+public class TicGitTicket implements Serializable, Comparable<TicGitTicket> {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public String id;\r
+       public String name;\r
+       public String title;\r
+       public String state;\r
+       public Date date;\r
+       public String handler;\r
+       public String milestone;\r
+       public String email;\r
+       public String author;\r
+       public List<Comment> comments;\r
+       public List<String> tags;\r
+\r
+       public TicGitTicket() {\r
+               state = "open";\r
+               comments = new ArrayList<Comment>();\r
+               tags = new ArrayList<String>();\r
+       }\r
+\r
+       public TicGitTicket(String ticketName) throws ParseException {\r
+               state = "";\r
+               name = ticketName;\r
+               comments = new ArrayList<Comment>();\r
+               tags = new ArrayList<String>();\r
+\r
+               String[] chunks = name.split("_");\r
+               if (chunks.length == 3) {\r
+                       date = new Date(Long.parseLong(chunks[0]) * 1000l);\r
+                       title = chunks[1].replace('-', ' ');\r
+               }               \r
+       }\r
+\r
+       public static class Comment implements Serializable, Comparable<Comment> {\r
+               \r
+               private static final long serialVersionUID = 1L;\r
+               \r
+               public String text;\r
+               public String author;\r
+               public Date date;\r
+\r
+               public Comment(String text, Date date) {\r
+                       this.text = text;\r
+                       this.date = date;\r
+               }\r
+\r
+               public Comment(String filename, String content) throws ParseException {\r
+                       String[] chunks = filename.split("_", -1);\r
+                       this.date = new Date(Long.parseLong(chunks[1]) * 1000l);\r
+                       this.author = chunks[2];\r
+                       this.text = content;\r
+               }\r
+\r
+               @Override\r
+               public int compareTo(Comment o) {\r
+                       return date.compareTo(o.date);\r
+               }\r
+       }\r
+\r
+       @Override\r
+       public int compareTo(TicGitTicket o) {\r
+               return date.compareTo(o.date);\r
+       }\r
+}\r
index 5d8176a2746471b08c2b9815a9ddadf866cd84ee..5c29eac2782eacd239e5eca947d25fd9265a8c08 100644 (file)
@@ -56,10 +56,14 @@ public abstract class BasePage extends WebPage {
        }\r
 \r
        protected String trimShortLog(String string) {\r
-               if (string.length() > 60) {\r
-                       return string.substring(0, 60) + "...";\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 string;\r
+               return value.substring(0, max - 3) + "...";\r
        }\r
 \r
        public void error(String message, Throwable t) {\r
index b5baa6537b887d8949498344b8691b82a31a4851..6e8a6dd5e1982fba50479571b80afaf88ace53fd 100644 (file)
@@ -29,13 +29,15 @@ import com.gitblit.StoredSettings;
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.models.RepositoryModel;\r
 import com.gitblit.wicket.pages.BlobPage;\r
+import com.gitblit.wicket.pages.BranchesPage;\r
 import com.gitblit.wicket.pages.CommitPage;\r
-import com.gitblit.wicket.pages.HeadsPage;\r
 import com.gitblit.wicket.pages.RepositoriesPage;\r
 import com.gitblit.wicket.pages.ShortLogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TagPage;\r
 import com.gitblit.wicket.pages.TagsPage;\r
+import com.gitblit.wicket.pages.TicGitPage;\r
+import com.gitblit.wicket.pages.TicGitTicketPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 \r
@@ -58,16 +60,20 @@ public class GitBlitWebApp extends WebApplication {
                // Grab Browser info (like timezone, etc)\r
                getRequestCycleSettings().setGatherExtendedBrowserInfo(true);\r
 \r
-               // setup the url paths\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("/tags", TagsPage.class, new String[] { "p" }));\r
-               mount(new MixedParamUrlCodingStrategy("/heads", HeadsPage.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
                mount(new MixedParamUrlCodingStrategy("/tag", TagPage.class, new String[] { "p", "h" }));\r
                mount(new MixedParamUrlCodingStrategy("/tree", TreePage.class, new String[] { "p", "h", "f" }));\r
                mount(new MixedParamUrlCodingStrategy("/blob", BlobPage.class, new String[] { "p", "h", "f" }));\r
                \r
+               // setup extended urls\r
+               mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "p" }));\r
+               mount(new MixedParamUrlCodingStrategy("/ticgittkt", TicGitTicketPage.class, new String[] { "p", "f" }));\r
+               \r
                repositories = new File(StoredSettings.getString("repositoriesFolder", "repos"));\r
                exportAll = StoredSettings.getBoolean("exportAll", true);\r
                repositoryResolver = new FileResolver(repositories, exportAll);\r
index 4371052b4cc33fcf99f31fd78b588a92113ee5bf..b4f6fdc320e0a7423ec5833b8d6302ffd4ef0e93 100644 (file)
@@ -114,5 +114,5 @@ public abstract class RepositoryPage extends BasePage {
                        return newCommitParameter();\r
                }\r
                return new PageParameters("p=" + repositoryName + ",h=" + commitId + ",f=" + path);\r
-       }\r
+       }       \r
 }\r
index e76b489dadda7d11187043d468cfe963a25f14ce..08de1105682924243ed6f79aa2f81052f71cab23 100644 (file)
@@ -34,6 +34,10 @@ public class RefModel implements Serializable, Comparable<RefModel> {
        public String getName() {\r
                return ref.getName();\r
        }\r
+       \r
+       public RevCommit getCommit() {\r
+               return commit;\r
+       }\r
 \r
        public ObjectId getCommitId() {\r
                return commit.getId();\r
@@ -46,7 +50,11 @@ public class RefModel implements Serializable, Comparable<RefModel> {
        public ObjectId getObjectId() {\r
                return ref.getObjectId();\r
        }\r
-\r
+       \r
+       public boolean isAnnotatedTag() {\r
+               return ref.isPeeled();\r
+       }\r
+               \r
        @Override\r
        public int compareTo(RefModel o) {\r
                return getDate().compareTo(o.getDate());\r
diff --git a/src/com/gitblit/wicket/pages/BranchesPage.html b/src/com/gitblit/wicket/pages/BranchesPage.html
new file mode 100644 (file)
index 0000000..d4e5919
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<html xmlns="http://www.w3.org/1999/xhtml" >\r
+<body>\r
+       <!-- page header -->\r
+       <div wicket:id="pageHeader"></div>\r
+\r
+       <!-- page nav links --> \r
+       <div wicket:id="pageLinks"></div>\r
+       \r
+       <!-- shortlog -->       \r
+       <div style="margin-top:5px;" class="header" wicket:id="summary"></div>  \r
+       <table class="pretty">\r
+               <tbody>\r
+                       <tr wicket:id="branch">\r
+                       <td><i><span wicket:id="branchDate"></span></i></td>\r
+                       <td><div wicket:id="branchName"></div></td>\r
+                       <td><div wicket:id="branchType"></div></td>\r
+                       <td class="rightAlign"><span wicket:id="branchLinks"></span></td>\r
+                       </tr>\r
+       </tbody>\r
+       </table>        \r
+       \r
+       <!-- footer -->\r
+       <div wicket:id="pageFooter"></div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/BranchesPage.java b/src/com/gitblit/wicket/pages/BranchesPage.java
new file mode 100644 (file)
index 0000000..1fc5f88
--- /dev/null
@@ -0,0 +1,71 @@
+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
+\r
+\r
+public class BranchesPage extends RepositoryPage {\r
+\r
+       public BranchesPage(PageParameters params) {\r
+               super(params, "branches");\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.close();\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 ? "remote":"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
+\r
+               // footer\r
+               addFooter();\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/pages/HeadsPage.html b/src/com/gitblit/wicket/pages/HeadsPage.html
deleted file mode 100644 (file)
index ed99c89..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<html xmlns="http://www.w3.org/1999/xhtml" >\r
-<body>\r
-       <!-- page header -->\r
-       <div wicket:id="pageHeader"></div>\r
-\r
-       <!-- page nav links --> \r
-       <div wicket:id="pageLinks"></div>\r
-       \r
-       <!-- shortlog -->       \r
-       <div class="header" wicket:id="summary"></div>  \r
-       <table>\r
-               <tbody>\r
-                       <tr wicket:id="head">\r
-                       <td><i><span wicket:id="headDate"></span></i></td>\r
-                       <td><div wicket:id="headName"></div></td>\r
-                       <td></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
-       \r
-       <!-- footer -->\r
-       <div wicket:id="pageFooter"></div>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/HeadsPage.java b/src/com/gitblit/wicket/pages/HeadsPage.java
deleted file mode 100644 (file)
index df5e00f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-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.utils.Utils;\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.models.RefModel;\r
-\r
-\r
-public class HeadsPage extends RepositoryPage {\r
-\r
-       public HeadsPage(PageParameters params) {\r
-               super(params, "heads");\r
-\r
-               Repository r = getRepository();\r
-               List<RefModel> tags = JGitUtils.getHeads(r, -1);\r
-               r.close();\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>("head", 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
-                               String date;\r
-                               if (entry.getDate() != null) {\r
-                                       date = Utils.timeAgo(entry.getDate());\r
-                               } else {\r
-                                       date = "";\r
-                               }\r
-                               Label headDateLabel = new Label("headDate", date);\r
-                               item.add(headDateLabel);\r
-                               WicketUtils.setCssClass(headDateLabel, Utils.timeAgoCss(entry.getDate()));\r
-\r
-                               item.add(new LinkPanel("headName", "list name", entry.getDisplayName(), ShortLogPage.class, newCommitParameter(entry.getName())));\r
-\r
-                               String clazz = counter % 2 == 0 ? "dark" : "light";\r
-                               WicketUtils.setCssClass(item, clazz);\r
-                               counter++;\r
-                       }\r
-               };\r
-               tagView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT);\r
-               add(tagView);\r
-\r
-               // footer\r
-               addFooter();\r
-       }\r
-}\r
index f5697cd6c3d5094c2aaa12fa5bf1a28485cd65c4..6a103e4b425fc3998447fa4315972395967e4e73 100644 (file)
        </table>        \r
        <div class="pager" wicket:id="shortlogMore"></div>\r
 \r
-       <!-- Open Heads Body -->\r
-       <div style="width:300px;float:right;">\r
+       <!-- Open Branches Body -->\r
+       <div style="width:400px; float:left;">\r
                <!-- heads -->\r
-               <div class="header" wicket:id="heads"></div>    \r
+               <div class="header" wicket:id="branches"></div> \r
                <table style="width:100%" class="pretty">\r
                        <tbody>\r
-                               <tr wicket:id="head">\r
-                                       <td class="date"><span wicket:id="headDate"></span></td>\r
-                                       <td><div wicket:id="headName"></div></td>\r
-                                       <td class="rightAlign"><span wicket:id="headLinks"></span></td>\r
+                               <tr wicket:id="branch">\r
+                                       <td class="date"><span wicket:id="branchDate"></span></td>\r
+                                       <td><div wicket:id="branchName"></div></td>\r
+                                       <td class="rightAlign"><span wicket:id="branchLinks"></span></td>\r
                                </tr>\r
                        </tbody>\r
                </table>\r
-               <div class="pager" wicket:id="allHeads"></div>\r
-               <!-- Close Heads Body -->\r
+               <div class="pager" wicket:id="allBranches"></div>\r
+               <!-- Close Branches Body -->\r
        </div>\r
-       \r
+\r
        <!-- Open Tags body -->\r
-       <div style="margin-right:305px;">\r
+       <div style="margin-left:405px;">\r
                <!-- tags -->\r
                <div class="header" wicket:id="tags"></div>     \r
                        <table style="width:100%" class="pretty">\r
index 507ba244cd037f5b83ca8a257d56014545f64c8f..b7be71a5efbeca371e81582db12b0e7f0cb6271e 100644 (file)
@@ -1,6 +1,8 @@
 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
@@ -32,7 +34,7 @@ import com.gitblit.wicket.WicketUtils;
 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.HeadLinksPanel;\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
@@ -126,14 +128,14 @@ public class SummaryPage extends RepositoryPage {
 \r
                                item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getCommitId().getName())));\r
 \r
-                               if (entry.getCommitId().equals(entry.getObjectId())) {\r
-                                       // simple tag\r
-                                       item.add(new Label("tagDescription", ""));\r
-                                       item.add(new TagLinksPanel("tagLinks", repositoryName, entry));\r
-                               } else {\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
@@ -147,33 +149,41 @@ public class SummaryPage extends RepositoryPage {
                        add(new LinkPanel("allTags", "link", "all tags...", TagsPage.class, newRepositoryParameter()));\r
                }\r
 \r
-               // heads\r
-               List<RefModel> heads = JGitUtils.getHeads(r, numberRefs);\r
-               add(new LinkPanel("heads", "title", "heads", HeadsPage.class, newRepositoryParameter()));\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", "branches", BranchesPage.class, newRepositoryParameter()));\r
 \r
-               ListDataProvider<RefModel> headsDp = new ListDataProvider<RefModel>(heads);\r
-               DataView<RefModel> headsView = new DataView<RefModel>("head", headsDp) {\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("headDate", entry.getDate()));\r
+                               item.add(createDateLabel("branchDate", entry.getDate()));\r
 \r
-                               item.add(new LinkPanel("headName", "list name", entry.getDisplayName(), ShortLogPage.class, newCommitParameter(entry.getName())));\r
+                               item.add(new LinkPanel("branchName", "list name", trimString(entry.getDisplayName(), 28), ShortLogPage.class, newCommitParameter(entry.getName())));\r
 \r
-                               item.add(new HeadLinksPanel("headLinks", repositoryName, entry));\r
+                               item.add(new BranchLinksPanel("branchLinks", repositoryName, entry));\r
 \r
                                setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
                };\r
-               add(headsView);\r
-               if (heads.size() < numberRefs) {\r
-                       add(new Label("allHeads", "").setVisible(false));\r
+               add(branchesView);\r
+               if (branches.size() < numberRefs) {\r
+                       add(new Label("allBranches", "").setVisible(false));\r
                } else {\r
-                       add(new LinkPanel("allHeads", "link", "all heads...", HeadsPage.class, newRepositoryParameter()));\r
+                       add(new LinkPanel("allBranches", "link", "all branches...", BranchesPage.class, newRepositoryParameter()));\r
                }\r
                \r
                // Display an activity line graph\r
index 5cfd1aff4da826a489ac701f5db43017f960242e..1f73ed0305b0f109e774de7332f4f2b9de00b133 100644 (file)
@@ -39,14 +39,14 @@ public class TagsPage extends RepositoryPage {
 \r
                                item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getObjectId().getName())));\r
 \r
-                               if (entry.getCommitId().equals(entry.getObjectId())) {\r
-                                       // simple tag on commit object\r
-                                       item.add(new Label("tagDescription", ""));\r
-                                       item.add(new TagLinksPanel("tagLinks", repositoryName, entry));\r
-                               } else {\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
diff --git a/src/com/gitblit/wicket/pages/TicGitPage.html b/src/com/gitblit/wicket/pages/TicGitPage.html
new file mode 100644 (file)
index 0000000..e3b9ed8
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<html xmlns="http://www.w3.org/1999/xhtml" >\r
+<body>\r
+       <!-- page header -->\r
+       <div wicket:id="pageHeader"></div>\r
+\r
+       <!-- page nav links --> \r
+       <div wicket:id="pageLinks"></div>\r
+\r
+       <!-- shortlog -->       \r
+       <div style="margin-top:5px;" class="header" wicket:id="summary"></div>  \r
+       <table style="width:100%" class="pretty">\r
+               <tbody>\r
+                       <tr wicket:id="ticket">\r
+                       <td style="padding:0; margin:0;" ><div wicket:id="ticketState"></div></td>\r
+                       <td class="date"><span wicket:id="ticketDate"></span></td>\r
+                       <td><div wicket:id="ticketHandler"></div></td>\r
+                       <td><div wicket:id="ticketTitle"></div></td>\r
+                       </tr>\r
+       </tbody>\r
+       </table>        \r
+       \r
+       <!-- footer -->\r
+       <div wicket:id="pageFooter"></div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/TicGitPage.java b/src/com/gitblit/wicket/pages/TicGitPage.java
new file mode 100644 (file)
index 0000000..889093d
--- /dev/null
@@ -0,0 +1,65 @@
+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.utils.TicGitTicket;\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
+\r
+public class TicGitPage extends RepositoryPage {\r
+\r
+       public TicGitPage(PageParameters params) {\r
+               super(params, "ticgit");\r
+\r
+               Repository r = getRepository();\r
+               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(r);\r
+               r.close();\r
+\r
+               // shortlog\r
+               add(new LinkPanel("summary", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
+\r
+               ListDataProvider<TicGitTicket> ticketsDp = new ListDataProvider<TicGitTicket>(tickets);\r
+               DataView<TicGitTicket> ticketsView = new DataView<TicGitTicket>("ticket", ticketsDp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<TicGitTicket> item) {\r
+                               final TicGitTicket entry = item.getModelObject();\r
+                               Label stateLabel = new Label("ticketState", entry.state);\r
+                               String css = null;\r
+                               if (entry.state.equals("open")) {\r
+                                       css = "bug_open";\r
+                               } else if (entry.state.equals("hold")) {\r
+                                       css = "bug_hold";\r
+                               } else if (entry.state.equals("resolved")) {\r
+                                       css = "bug_resolved";\r
+                               } else if (entry.state.equals("invalid")) {\r
+                                       css = "bug_invalid";\r
+                               }\r
+                               if (css != null) {\r
+                                       WicketUtils.setCssClass(stateLabel, css);\r
+                               }\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
+\r
+                               setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(ticketsView);\r
+\r
+               // footer\r
+               addFooter();\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.html b/src/com/gitblit/wicket/pages/TicGitTicketPage.html
new file mode 100644 (file)
index 0000000..b66bf50
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<html xmlns="http://www.w3.org/1999/xhtml" >\r
+<body>\r
+       <!-- page header -->\r
+       <div wicket:id="pageHeader"></div>\r
+\r
+       <!-- page nav links --> \r
+       <div wicket:id="pageLinks"></div>\r
+       \r
+       <!-- ticket title -->\r
+       <div style="font-size:150%;padding-top:5px;" wicket:id="ticketTitle"></div>\r
+               \r
+       <!-- ticket info -->\r
+       <table class="plain">\r
+               <tr><th>ticket id</th><td class="sha1"><span wicket:id="ticketId">Message goes here</span></td></tr>\r
+               <tr><th>assigned</th><td><span wicket:id=ticketHandler>Message goes here</span></td></tr>\r
+               <tr><th>open date</th><td><span wicket:id="ticketOpenDate">Message goes here</span></td></tr>\r
+               <tr><th>state</th><td><span wicket:id="ticketState">Message goes here</span></td></tr>\r
+               <tr><th>tags</th><td><span wicket:id="ticketTags">Message goes here</span></td></tr>\r
+       </table>\r
+       \r
+       <!-- comments header -->\r
+       <div class="header">Comments</div>\r
+       \r
+       <!-- comments -->\r
+       <table style="width:100%;" class="pretty">\r
+               <tbody>\r
+                       <tr wicket:id="comment">\r
+                       <td class="date"><span wicket:id="commentDate"></span></td>\r
+                       <td><b><div wicket:id="commentAuthor"></div></b></td>\r
+                       <td><div wicket:id="commentText"></div></td>\r
+                       </tr>\r
+               </tbody>\r
+    </table>\r
+    \r
+       <!-- footer -->\r
+       <div wicket:id="pageFooter"></div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.java b/src/com/gitblit/wicket/pages/TicGitTicketPage.java
new file mode 100644 (file)
index 0000000..6390500
--- /dev/null
@@ -0,0 +1,70 @@
+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.utils.TicGitTicket;\r
+import com.gitblit.utils.TicGitTicket.Comment;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
+\r
+public class TicGitTicketPage extends RepositoryPage {\r
+\r
+       public TicGitTicketPage(PageParameters params) {\r
+               super(params, "ticgit ticket");\r
+\r
+               final String ticketFolder = params.getString("f", "");\r
+\r
+               Repository r = getRepository();\r
+               TicGitTicket t = JGitUtils.getTicGitTicket(r, ticketFolder);\r
+               r.close();\r
+\r
+               add(new Label("ticketTitle", t.title));\r
+               add(new Label("ticketId", t.id));\r
+               add(new Label("ticketHandler", t.handler));\r
+               String openDate = GitBlitWebSession.get().formatDateTimeLong(t.date);\r
+               add(new Label("ticketOpenDate", openDate));\r
+               add(new Label("ticketState", t.state));\r
+               add(new Label("ticketTags", flattenStrings(t.tags)));\r
+\r
+               ListDataProvider<Comment> commentsDp = new ListDataProvider<Comment>(t.comments);\r
+               DataView<Comment> commentsView = new DataView<Comment>("comment", commentsDp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<Comment> item) {\r
+                               final Comment entry = item.getModelObject();\r
+                               item.add(createDateLabel("commentDate", entry.date));\r
+                               item.add(new Label("commentAuthor", entry.author));\r
+                               item.add(new Label("commentText", prepareComment(entry.text)).setEscapeModelStrings(false));\r
+                               setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(commentsView);\r
+\r
+               // footer\r
+               addFooter();\r
+       }\r
+\r
+       private String prepareComment(String comment) {\r
+               String html = WicketUtils.breakLines(comment).trim();\r
+               return html.replaceAll("\\bcommit\\s*([A-Za-z0-9]*)\\b", "<a href=\"/commit/" + repositoryName + "/$1\">commit $1</a>");\r
+       }\r
+\r
+       private String flattenStrings(List<String> values) {\r
+               StringBuilder sb = new StringBuilder();\r
+               for (String value : values) {\r
+                       sb.append(value).append(" ");\r
+               }\r
+               return sb.toString().trim();\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/panels/BranchLinksPanel.html b/src/com/gitblit/wicket/panels/BranchLinksPanel.html
new file mode 100644 (file)
index 0000000..04c6659
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">\r
+<wicket:panel>\r
+       <div class="link">\r
+               <span wicket:id="shortlog"></span> | <span wicket:id="tree"></span>\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
new file mode 100644 (file)
index 0000000..bc74317
--- /dev/null
@@ -0,0 +1,21 @@
+package com.gitblit.wicket.panels;\r
+\r
+import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.markup.html.panel.Panel;\r
+\r
+import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.models.RefModel;\r
+import com.gitblit.wicket.pages.ShortLogPage;\r
+import com.gitblit.wicket.pages.TreePage;\r
+\r
+\r
+public class BranchLinksPanel extends Panel {\r
+\r
+       private static final long serialVersionUID = 1L;\r
+\r
+       public BranchLinksPanel(String id, String repositoryName, RefModel tag) {\r
+               super(id);\r
+               add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
+               add(new LinkPanel("tree", null, "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/HeadLinksPanel.html b/src/com/gitblit/wicket/panels/HeadLinksPanel.html
deleted file mode 100644 (file)
index 04c6659..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">\r
-<wicket:panel>\r
-       <div class="link">\r
-               <span wicket:id="shortlog"></span> | <span wicket:id="tree"></span>\r
-       </div>  \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/panels/HeadLinksPanel.java b/src/com/gitblit/wicket/panels/HeadLinksPanel.java
deleted file mode 100644 (file)
index eeb2ae4..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.basic.Label;\r
-import org.apache.wicket.markup.html.panel.Panel;\r
-\r
-import com.gitblit.wicket.LinkPanel;\r
-import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.pages.ShortLogPage;\r
-\r
-\r
-public class HeadLinksPanel extends Panel {\r
-\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       public HeadLinksPanel(String id, String repositoryName, RefModel tag) {\r
-               super(id);\r
-               add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));\r
-               add(new Label("tree", "tree"));\r
-       }\r
-}
\ No newline at end of file
index 5a2f8ec7ff195754b0b75d36958515daeeeca2d9..072221feab84e8863483a30492b6fe54da16d454 100644 (file)
@@ -3,7 +3,7 @@
 <wicket:panel>\r
        <!-- page nav links --> \r
        <div class="page_nav">\r
-               <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="tags"></span> | <span wicket:id="commit"></span> | <span wicket:id="commitdiff"></span> | <span wicket:id="tree"></span>\r
+               <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="branches"></span> | <span wicket:id="tags"></span> | <span wicket:id="tree"></span>\r
        </div>  \r
 </wicket:panel>\r
 </html>
\ No newline at end of file
index 02491bca5c05daca62da90a7bda9b88c7feefb25..23f338352de46475a2fe944931bfab4982f335fa 100644 (file)
@@ -5,6 +5,7 @@ import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.panel.Panel;\r
 \r
 import com.gitblit.wicket.LinkPanel;\r
+import com.gitblit.wicket.pages.BranchesPage;\r
 import com.gitblit.wicket.pages.CommitPage;\r
 import com.gitblit.wicket.pages.ShortLogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
@@ -32,25 +33,20 @@ public class PageLinksPanel extends Panel {
                        add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName)));\r
                }\r
                \r
+               // branches\r
+               if (pageName.equals("branches")) {\r
+                       add(new Label("branches", pageName));\r
+               } else {\r
+                       add(new LinkPanel("branches", null, "branches", BranchesPage.class, new PageParameters("p=" + repositoryName)));\r
+               }\r
+               \r
                // tags\r
                if (pageName.equals("tags")) {\r
                        add(new Label("tags", pageName));\r
                } else {\r
                        add(new LinkPanel("tags", null, "tags", TagsPage.class, new PageParameters("p=" + repositoryName)));\r
                }\r
-\r
-               // commit\r
-               if (pageName.equals("commit")) {\r
-                       add(new Label("commit", pageName));\r
-               } else {\r
-                       add(new LinkPanel("commit", null, "commit", CommitPage.class, new PageParameters("p=" + repositoryName + ",h=HEAD")));\r
-               }\r
-               // commitdiff\r
-               if (pageName.equals("commitdiff")) {\r
-                       add(new Label("commitdiff", pageName));\r
-               } else {\r
-                       add(new Label("commitdiff", "commitdiff"));\r
-               }\r
+               \r
                // tree\r
                if (pageName.equals("tree")) {\r
                        add(new Label("tree", pageName));\r