]> source.dussan.org Git - gitblit.git/commitdiff
Rename ticgit integration to tickets.
authorJames Moger <james.moger@gitblit.com>
Sun, 17 Apr 2011 16:06:29 +0000 (12:06 -0400)
committerJames Moger <james.moger@gitblit.com>
Sun, 17 Apr 2011 16:06:29 +0000 (12:06 -0400)
The current ticgit implementation is based on ticgit.net, a BSD
implementation for C#.  Jeff Welling advises using commit
bf57b032e030bd16a7b2 (2009-01-27) from ticgit as the last MIT licensed
commit.

A more complete implementation will be based on this version of the
original Ruby sources.  It remains unclear if I will support using the
"ticgit" branch name or not.  I purposefully haven't looked at any of
the GPL improvements by Jeff, but I can see from the readme at GitHub
that he has renamed the branch to "ticgit-ng" which I have no plans on
supporting as I do not want to taint GitBlit with GPL code.

17 files changed:
gitblit.properties
src/com/gitblit/tests/JGitUtilsTest.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/wicket/GitBlitWebApp.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/models/TicGitTicket.java [deleted file]
src/com/gitblit/wicket/models/TicketModel.java [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicGitPage.html [deleted file]
src/com/gitblit/wicket/pages/TicGitPage.java [deleted file]
src/com/gitblit/wicket/pages/TicGitTicketPage.html [deleted file]
src/com/gitblit/wicket/pages/TicGitTicketPage.java [deleted file]
src/com/gitblit/wicket/pages/TicketPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicketPage.java [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicketsPage.html [new file with mode: 0644]
src/com/gitblit/wicket/pages/TicketsPage.java [new file with mode: 0644]
src/com/gitblit/wicket/panels/HistoryPanel.java
src/com/gitblit/wicket/panels/PageLinksPanel.java

index a4828108d53d81f00bf291ad85d3d50774ab8bbe..93183eb7ae6b73059cf3cab7fb190bf513141f9a 100644 (file)
@@ -103,11 +103,11 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
 # Example per-repository regex substitutions overrides global\r
 #regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
 \r
-# Enable ticgit pages for all repositories (if ticgit branch is present)\r
-ticgit.global = false\r
+# Enable tickets pages for all repositories (if ticgit branch is present)\r
+tickets.global = false\r
 \r
-# Enable ticgit pages for specified repository (if ticgit branch is present)\r
-#ticgit.myrepository = true\r
+# Enable tickets pages for specified repository (if ticgit branch is present)\r
+#tickets.myrepository = true\r
 \r
 #\r
 # Server Settings\r
index c77aaaf10afe9a879ce89abccf5c1fa36dad05b1..b6b497f0ef8d8cbafbc2ea34438097b7968f4dcb 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.jgit.storage.file.FileRepository;
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.models.TicGitTicket;\r
+import com.gitblit.wicket.models.TicketModel;\r
 \r
 public class JGitUtilsTest extends TestCase {\r
 \r
@@ -72,9 +72,9 @@ public class JGitUtilsTest extends TestCase {
 \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
+               RefModel ticgit = JGitUtils.getTicketsBranch(r);\r
                assertTrue("Ticgit branch does not exist!", ticgit != null);\r
-               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(r);\r
+               List<TicketModel> tickets = JGitUtils.getTickets(r);\r
                assertTrue("No tickets found!", tickets.size() > 0);\r
                r.close();\r
        }\r
index 7128f722257837264088aeb101220e17e333a685..075ad81b7ca4956dcc2b8f4a85f7f915bd9393b6 100644 (file)
@@ -46,8 +46,8 @@ import org.slf4j.LoggerFactory;
 import com.gitblit.wicket.models.Metric;\r
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.models.RefModel;\r
-import com.gitblit.wicket.models.TicGitTicket;\r
-import com.gitblit.wicket.models.TicGitTicket.Comment;\r
+import com.gitblit.wicket.models.TicketModel;\r
+import com.gitblit.wicket.models.TicketModel.Comment;\r
 \r
 public class JGitUtils {\r
 \r
@@ -614,12 +614,12 @@ public class JGitUtils {
                return metrics;\r
        }\r
 \r
-       public static RefModel getTicGitBranch(Repository r) {\r
+       public static RefModel getTicketsBranch(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
+                               if (ref.getDisplayName().endsWith("ticgit")) {\r
                                        ticgitBranch = ref;\r
                                        break;\r
                                }\r
@@ -628,7 +628,7 @@ public class JGitUtils {
                        // 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
+                                       if (ref.getDisplayName().endsWith("ticgit")) {\r
                                                ticgitBranch = ref;\r
                                                break;\r
                                        }\r
@@ -640,18 +640,18 @@ public class JGitUtils {
                return ticgitBranch;\r
        }\r
 \r
-       public static List<TicGitTicket> getTicGitTickets(Repository r) {\r
-               RefModel ticgitBranch = getTicGitBranch(r);\r
+       public static List<TicketModel> getTickets(Repository r) {\r
+               RefModel ticgitBranch = getTicketsBranch(r);\r
                List<PathModel> paths = getFilesInPath(r, null, ticgitBranch.getCommit());\r
-               List<TicGitTicket> tickets = new ArrayList<TicGitTicket>();\r
+               List<TicketModel> tickets = new ArrayList<TicketModel>();\r
                for (PathModel ticketFolder : paths) {\r
                        if (ticketFolder.isTree()) {\r
                                try {\r
-                                       TicGitTicket t = new TicGitTicket(ticketFolder.name);\r
+                                       TicketModel t = new TicketModel(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
+                                       LOGGER.error("Failed to get a ticket!", t);\r
                                }\r
                        }\r
                }\r
@@ -660,24 +660,24 @@ public class JGitUtils {
                return tickets;\r
        }\r
 \r
-       public static TicGitTicket getTicGitTicket(Repository r, String ticketFolder) {\r
-               RefModel ticgitBranch = getTicGitBranch(r);\r
-               if (ticgitBranch != null) {\r
+       public static TicketModel getTicket(Repository r, String ticketFolder) {\r
+               RefModel ticketsBranch = getTicketsBranch(r);\r
+               if (ticketsBranch != null) {\r
                        try {\r
-                               TicGitTicket ticket = new TicGitTicket(ticketFolder);\r
-                               readTicketContents(r, ticgitBranch, ticket);\r
+                               TicketModel ticket = new TicketModel(ticketFolder);\r
+                               readTicketContents(r, ticketsBranch, ticket);\r
                                return ticket;\r
                        } catch (Throwable t) {\r
-                               LOGGER.error("Failed to get ticgit ticket " + ticketFolder, t);\r
+                               LOGGER.error("Failed to get 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
+       private static void readTicketContents(Repository r, RefModel ticketsBranch, TicketModel ticket) {\r
+               List<PathModel> ticketFiles = getFilesInPath(r, ticket.name, ticketsBranch.getCommit());\r
                for (PathModel file : ticketFiles) {\r
-                       String content = getRawContentAsString(r, ticgitBranch.getCommit(), file.path).trim();\r
+                       String content = getRawContentAsString(r, ticketsBranch.getCommit(), file.path).trim();\r
                        if (file.name.equals("TICKET_ID")) {\r
                                ticket.id = content;\r
                        } else if (file.name.equals("TITLE")) {\r
@@ -707,10 +707,10 @@ public class JGitUtils {
                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
+       public static String getTicketContent(Repository r, String filePath) {\r
+               RefModel ticketsBranch = getTicketsBranch(r);\r
+               if (ticketsBranch != null) {\r
+                       return getRawContentAsString(r, ticketsBranch.getCommit(), filePath);\r
                }\r
                return "";\r
        }\r
index 28f62625f258a4918aa97bd2566a8388efc8e99e..74057c99d7e57761445ab0d8f1623869e12111fe 100644 (file)
@@ -25,8 +25,8 @@ import com.gitblit.wicket.pages.RepositoriesPage;
 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.TicketsPage;\r
+import com.gitblit.wicket.pages.TicketPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 public class GitBlitWebApp extends WebApplication {\r
@@ -63,9 +63,9 @@ public class GitBlitWebApp extends WebApplication {
                mount(new MixedParamUrlCodingStrategy("/patch", PatchPage.class, new String[] { "r", "h", "f" }));\r
                mount(new MixedParamUrlCodingStrategy("/history", HistoryPage.class, new String[] { "r", "h", "f" }));\r
 \r
-               // setup ticgit urls\r
-               mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "r" }));\r
-               mount(new MixedParamUrlCodingStrategy("/ticgittkt", TicGitTicketPage.class, new String[] { "r", "h", "f" }));\r
+               // setup ticket urls\r
+               mount(new MixedParamUrlCodingStrategy("/tickets", TicketsPage.class, new String[] { "r" }));\r
+               mount(new MixedParamUrlCodingStrategy("/ticket", TicketPage.class, new String[] { "r", "h", "f" }));\r
 \r
                // setup login/logout urls, if we are using authentication\r
                if (useAuthentication) {\r
index 033742ebeec56668728111585c7269cf95c43917..331fc2940cc340e1503e3c0620e4330e64d1e5ce 100644 (file)
@@ -34,7 +34,7 @@ gb.ticket = ticket
 gb.newRepository = new repository\r
 gb.newUser = new user\r
 gb.commitdiff = commitdiff\r
-gb.ticgit = ticgit\r
+gb.tickets = tickets\r
 gb.pageFirst = first\r
 gb.pagePrevious prev\r
 gb.pageNext = next\r
diff --git a/src/com/gitblit/wicket/models/TicGitTicket.java b/src/com/gitblit/wicket/models/TicGitTicket.java
deleted file mode 100644 (file)
index 6bbb7be..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.gitblit.wicket.models;\r
-\r
-import java.io.Serializable;\r
-import java.text.ParseException;\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.List;\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
diff --git a/src/com/gitblit/wicket/models/TicketModel.java b/src/com/gitblit/wicket/models/TicketModel.java
new file mode 100644 (file)
index 0000000..39f3c90
--- /dev/null
@@ -0,0 +1,74 @@
+package com.gitblit.wicket.models;\r
+\r
+import java.io.Serializable;\r
+import java.text.ParseException;\r
+import java.util.ArrayList;\r
+import java.util.Date;\r
+import java.util.List;\r
+\r
+public class TicketModel implements Serializable, Comparable<TicketModel> {\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 TicketModel() {\r
+               state = "open";\r
+               comments = new ArrayList<Comment>();\r
+               tags = new ArrayList<String>();\r
+       }\r
+\r
+       public TicketModel(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(TicketModel o) {\r
+               return date.compareTo(o.date);\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/pages/TicGitPage.html b/src/com/gitblit/wicket/pages/TicGitPage.html
deleted file mode 100644 (file)
index eb74b12..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
-       <!-- header --> \r
-       <div style="margin-top:5px;" class="header" wicket:id="header">[header]</div>\r
-       \r
-       <!-- tickets -->        \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">[ticket state]</div></td>\r
-                       <td class="date"><span wicket:id="ticketDate">[ticket date]</span></td>\r
-                       <td class="author"><div wicket:id="ticketHandler">[ticket handler]</div></td>\r
-                       <td><div wicket:id="ticketTitle">[ticket title]</div></td>\r
-                       </tr>\r
-       </tbody>\r
-       </table>        \r
-\r
-</wicket:extend>\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
deleted file mode 100644 (file)
index a03ee60..0000000
+++ /dev/null
@@ -1,54 +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
-\r
-import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.StringUtils;\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.TicGitTicket;\r
-\r
-public class TicGitPage extends RepositoryPage {\r
-\r
-       public TicGitPage(PageParameters params) {\r
-               super(params);\r
-\r
-               List<TicGitTicket> tickets = JGitUtils.getTicGitTickets(getRepository());\r
-\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
-                       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
-                               WicketUtils.setTicketCssClass(stateLabel, entry.state);\r
-                               item.add(stateLabel);\r
-                               item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
-                               item.add(new Label("ticketHandler", StringUtils.trimString(entry.handler.toLowerCase(), 30)));\r
-                               item.add(new LinkPanel("ticketTitle", "list subject", StringUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name)));\r
-\r
-                               WicketUtils.setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(ticketsView);\r
-       }\r
-\r
-       @Override\r
-       protected String getPageName() {\r
-               return getString("gb.ticgit");\r
-       }\r
-}\r
diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.html b/src/com/gitblit/wicket/pages/TicGitTicketPage.html
deleted file mode 100644 (file)
index 56e2980..0000000
+++ /dev/null
@@ -1,42 +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
-       <!-- ticket title -->\r
-       <div style="font-size:150%;padding-top:5px;" wicket:id="ticketTitle">[ticket title]</div>\r
-               \r
-       <!-- ticket info -->\r
-       <table class="plain">\r
-               <tr><th><wicket:message key="gb.ticketId">ticket id</wicket:message></th><td><span class="sha1" wicket:id="ticketId">[ticket id]</span></td></tr>\r
-               <tr><th><wicket:message key="gb.ticketAssigned">assigned</wicket:message></th><td><span wicket:id=ticketHandler>[ticket title]</span></td></tr>\r
-               <tr><th><wicket:message key="gb.ticketOpenDate">open date</wicket:message></th><td><span wicket:id="ticketOpenDate">[ticket open date]</span></td></tr>\r
-               <tr><th><wicket:message key="gb.ticketState">state</wicket:message></th><td><span wicket:id="ticketState">[ticket state]</span></td></tr>\r
-               <tr><th><wicket:message key="gb.tags">tags</wicket:message></th><td><span wicket:id="ticketTags">[ticket tags]</span></td></tr>\r
-       </table>\r
-       \r
-       <!-- comments header -->\r
-       <div class="header"><wicket:message key="gb.ticketComments">comments</wicket:message></div>\r
-       \r
-       <!-- comments -->\r
-       <table style="width:100%;" class="comments">\r
-               <tbody>\r
-                       <tr valign="top" wicket:id="comment">\r
-                       <td><span class="author" wicket:id="commentAuthor">[comment author]</span><br/>\r
-                               <span class="date" wicket:id="commentDate">[comment date]</span>\r
-                       </td>\r
-                       <td><span wicket:id="commentText">[comment text]</span></td>\r
-                       </tr>\r
-               </tbody>\r
-    </table>\r
-\r
-</wicket:extend>    \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
deleted file mode 100644 (file)
index b4c9cf5..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.gitblit.wicket.pages;\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.StringUtils;\r
-import com.gitblit.wicket.GitBlitWebSession;\r
-import com.gitblit.wicket.RepositoryPage;\r
-import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.models.TicGitTicket;\r
-import com.gitblit.wicket.models.TicGitTicket.Comment;\r
-\r
-public class TicGitTicketPage extends RepositoryPage {\r
-\r
-       public TicGitTicketPage(PageParameters params) {\r
-               super(params);\r
-\r
-               final String ticketFolder = WicketUtils.getPath(params);\r
-\r
-               Repository r = getRepository();\r
-               TicGitTicket t = JGitUtils.getTicGitTicket(r, ticketFolder);\r
-\r
-               add(new Label("ticketTitle", t.title));\r
-               add(new Label("ticketId", t.id));\r
-               add(new Label("ticketHandler", t.handler.toLowerCase()));\r
-               add(WicketUtils.createTimestampLabel("ticketOpenDate", t.date, getTimeZone()));\r
-               Label stateLabel = new Label("ticketState", t.state);\r
-               WicketUtils.setTicketCssClass(stateLabel, t.state);\r
-               add(stateLabel);\r
-               add(new Label("ticketTags", StringUtils.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(WicketUtils.createDateLabel("commentDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
-                               item.add(new Label("commentAuthor", entry.author.toLowerCase()));\r
-                               item.add(new Label("commentText", prepareComment(entry.text)).setEscapeModelStrings(false));\r
-                               WicketUtils.setAlternatingBackground(item, counter);\r
-                               counter++;\r
-                       }\r
-               };\r
-               add(commentsView);\r
-       }\r
-\r
-       @Override\r
-       protected String getPageName() {\r
-               return getString("gb.ticket");\r
-       }\r
-\r
-       private String prepareComment(String comment) {\r
-               String html = StringUtils.escapeForHtml(comment, false);\r
-               html = StringUtils.breakLinesForHtml(comment).trim();\r
-               return html.replaceAll("\\bcommit\\s*([A-Za-z0-9]*)\\b", "<a href=\"/commit/" + repositoryName + "/$1\">commit $1</a>");\r
-       }\r
-}\r
diff --git a/src/com/gitblit/wicket/pages/TicketPage.html b/src/com/gitblit/wicket/pages/TicketPage.html
new file mode 100644 (file)
index 0000000..56e2980
--- /dev/null
@@ -0,0 +1,42 @@
+<!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
+       <!-- ticket title -->\r
+       <div style="font-size:150%;padding-top:5px;" wicket:id="ticketTitle">[ticket title]</div>\r
+               \r
+       <!-- ticket info -->\r
+       <table class="plain">\r
+               <tr><th><wicket:message key="gb.ticketId">ticket id</wicket:message></th><td><span class="sha1" wicket:id="ticketId">[ticket id]</span></td></tr>\r
+               <tr><th><wicket:message key="gb.ticketAssigned">assigned</wicket:message></th><td><span wicket:id=ticketHandler>[ticket title]</span></td></tr>\r
+               <tr><th><wicket:message key="gb.ticketOpenDate">open date</wicket:message></th><td><span wicket:id="ticketOpenDate">[ticket open date]</span></td></tr>\r
+               <tr><th><wicket:message key="gb.ticketState">state</wicket:message></th><td><span wicket:id="ticketState">[ticket state]</span></td></tr>\r
+               <tr><th><wicket:message key="gb.tags">tags</wicket:message></th><td><span wicket:id="ticketTags">[ticket tags]</span></td></tr>\r
+       </table>\r
+       \r
+       <!-- comments header -->\r
+       <div class="header"><wicket:message key="gb.ticketComments">comments</wicket:message></div>\r
+       \r
+       <!-- comments -->\r
+       <table style="width:100%;" class="comments">\r
+               <tbody>\r
+                       <tr valign="top" wicket:id="comment">\r
+                       <td><span class="author" wicket:id="commentAuthor">[comment author]</span><br/>\r
+                               <span class="date" wicket:id="commentDate">[comment date]</span>\r
+                       </td>\r
+                       <td><span wicket:id="commentText">[comment text]</span></td>\r
+                       </tr>\r
+               </tbody>\r
+    </table>\r
+\r
+</wicket:extend>    \r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/TicketPage.java b/src/com/gitblit/wicket/pages/TicketPage.java
new file mode 100644 (file)
index 0000000..1cfa809
--- /dev/null
@@ -0,0 +1,64 @@
+package com.gitblit.wicket.pages;\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.StringUtils;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
+import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.models.TicketModel;\r
+import com.gitblit.wicket.models.TicketModel.Comment;\r
+\r
+public class TicketPage extends RepositoryPage {\r
+\r
+       public TicketPage(PageParameters params) {\r
+               super(params);\r
+\r
+               final String ticketFolder = WicketUtils.getPath(params);\r
+\r
+               Repository r = getRepository();\r
+               TicketModel t = JGitUtils.getTicket(r, ticketFolder);\r
+\r
+               add(new Label("ticketTitle", t.title));\r
+               add(new Label("ticketId", t.id));\r
+               add(new Label("ticketHandler", t.handler.toLowerCase()));\r
+               add(WicketUtils.createTimestampLabel("ticketOpenDate", t.date, getTimeZone()));\r
+               Label stateLabel = new Label("ticketState", t.state);\r
+               WicketUtils.setTicketCssClass(stateLabel, t.state);\r
+               add(stateLabel);\r
+               add(new Label("ticketTags", StringUtils.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(WicketUtils.createDateLabel("commentDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
+                               item.add(new Label("commentAuthor", entry.author.toLowerCase()));\r
+                               item.add(new Label("commentText", prepareComment(entry.text)).setEscapeModelStrings(false));\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(commentsView);\r
+       }\r
+\r
+       @Override\r
+       protected String getPageName() {\r
+               return getString("gb.ticket");\r
+       }\r
+\r
+       private String prepareComment(String comment) {\r
+               String html = StringUtils.escapeForHtml(comment, false);\r
+               html = StringUtils.breakLinesForHtml(comment).trim();\r
+               return html.replaceAll("\\bcommit\\s*([A-Za-z0-9]*)\\b", "<a href=\"/commit/" + repositoryName + "/$1\">commit $1</a>");\r
+       }\r
+}\r
diff --git a/src/com/gitblit/wicket/pages/TicketsPage.html b/src/com/gitblit/wicket/pages/TicketsPage.html
new file mode 100644 (file)
index 0000000..eb74b12
--- /dev/null
@@ -0,0 +1,30 @@
+<!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
+       <!-- header --> \r
+       <div style="margin-top:5px;" class="header" wicket:id="header">[header]</div>\r
+       \r
+       <!-- tickets -->        \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">[ticket state]</div></td>\r
+                       <td class="date"><span wicket:id="ticketDate">[ticket date]</span></td>\r
+                       <td class="author"><div wicket:id="ticketHandler">[ticket handler]</div></td>\r
+                       <td><div wicket:id="ticketTitle">[ticket title]</div></td>\r
+                       </tr>\r
+       </tbody>\r
+       </table>        \r
+\r
+</wicket:extend>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/TicketsPage.java b/src/com/gitblit/wicket/pages/TicketsPage.java
new file mode 100644 (file)
index 0000000..865b8bf
--- /dev/null
@@ -0,0 +1,54 @@
+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
+\r
+import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.utils.StringUtils;\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.TicketModel;\r
+\r
+public class TicketsPage extends RepositoryPage {\r
+\r
+       public TicketsPage(PageParameters params) {\r
+               super(params);\r
+\r
+               List<TicketModel> tickets = JGitUtils.getTickets(getRepository());\r
+\r
+               // header\r
+               add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, newRepositoryParameter()));\r
+\r
+               ListDataProvider<TicketModel> ticketsDp = new ListDataProvider<TicketModel>(tickets);\r
+               DataView<TicketModel> ticketsView = new DataView<TicketModel>("ticket", ticketsDp) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       int counter = 0;\r
+\r
+                       public void populateItem(final Item<TicketModel> item) {\r
+                               final TicketModel entry = item.getModelObject();\r
+                               Label stateLabel = new Label("ticketState", entry.state);\r
+                               WicketUtils.setTicketCssClass(stateLabel, entry.state);\r
+                               item.add(stateLabel);\r
+                               item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession.get().getTimezone()));\r
+                               item.add(new Label("ticketHandler", StringUtils.trimString(entry.handler.toLowerCase(), 30)));\r
+                               item.add(new LinkPanel("ticketTitle", "list subject", StringUtils.trimString(entry.title, 80), TicketPage.class, newPathParameter(entry.name)));\r
+\r
+                               WicketUtils.setAlternatingBackground(item, counter);\r
+                               counter++;\r
+                       }\r
+               };\r
+               add(ticketsView);\r
+       }\r
+\r
+       @Override\r
+       protected String getPageName() {\r
+               return getString("gb.tickets");\r
+       }\r
+}\r
index 236e077b4117b0449a8c2a61f2b8ec965e294302..e78788384be9288092372820f24a8b9c0b55ab59 100644 (file)
@@ -93,6 +93,7 @@ public class HistoryPanel extends BasePanel {
 \r
                                item.add(new RefsPanel("commitRefs", repositoryName, entry, allRefs));\r
 \r
+                               // TODO links for folder\r
                                item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                item.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                item.add(new BookmarkablePageLink<Void>("difftocurrent", BlobDiffPage.class, WicketUtils.newPathParameter(repositoryName, entry.getName(), path)).setEnabled(counter > 0));\r
index 18cfad6246e6693bc27e3c4df46be98ac6d12b13..f8824db56ebda74c36bbb4ec42be88a1a2e47ad9 100644 (file)
@@ -24,7 +24,7 @@ import com.gitblit.wicket.pages.BranchesPage;
 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.TicketsPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 public class PageLinksPanel extends Panel {\r
@@ -41,7 +41,7 @@ public class PageLinksPanel extends Panel {
                        put("branches", "gb.branches");\r
                        put("tags", "gb.tags");\r
                        put("tree", "gb.tree");\r
-                       put("ticgit", "gb.ticgit");\r
+                       put("tickets", "gb.tickets");\r
                }\r
        };\r
 \r
@@ -55,14 +55,14 @@ public class PageLinksPanel extends Panel {
                add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
 \r
-               // Get the repository ticgit setting\r
-               boolean checkTicgit = GitBlit.self().settings().getBoolean(Keys.ticgit.global, false);\r
-               checkTicgit |= GitBlit.self().settings().getBoolean(MessageFormat.format(Keys.ticgit._ROOT + ".{0}", repositoryName), false);\r
+               // Get the repository tickets setting\r
+               boolean checkTicgit = GitBlit.self().settings().getBoolean(Keys.tickets.global, false);\r
+               checkTicgit |= GitBlit.self().settings().getBoolean(MessageFormat.format(Keys.tickets._ROOT + ".{0}", repositoryName), false);\r
 \r
                // Add dynamic repository extras\r
                List<String> extras = new ArrayList<String>();\r
-               if (checkTicgit && JGitUtils.getTicGitBranch(r) != null) {\r
-                       extras.add("ticgit");\r
+               if (checkTicgit && JGitUtils.getTicketsBranch(r) != null) {\r
+                       extras.add("tickets");\r
                }\r
 \r
                ListDataProvider<String> extrasDp = new ListDataProvider<String>(extras);\r
@@ -71,9 +71,9 @@ public class PageLinksPanel extends Panel {
 \r
                        public void populateItem(final Item<String> item) {\r
                                String extra = item.getModelObject();\r
-                               if (extra.equals("ticgit")) {\r
+                               if (extra.equals("tickets")) {\r
                                        item.add(new Label("extraSeparator", " | "));\r
-                                       item.add(new LinkPanel("extraLink", null, "ticgit", TicGitPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                                       item.add(new LinkPanel("extraLink", null, "tickets", TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                                }\r
                        }\r
                };\r