]> source.dussan.org Git - gitblit.git/commitdiff
Fixed ticgit pages.
authorJames Moger <james.moger@gitblit.com>
Wed, 13 Apr 2011 20:27:17 +0000 (16:27 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 13 Apr 2011 20:27:17 +0000 (16:27 -0400)
src/com/gitblit/wicket/GitBlitWebApp.java
src/com/gitblit/wicket/pages/TicGitPage.html
src/com/gitblit/wicket/pages/TicGitPage.java
src/com/gitblit/wicket/pages/TicGitTicketPage.html
src/com/gitblit/wicket/pages/TicGitTicketPage.java
src/com/gitblit/wicket/resources/gitblit.css

index b869a05fa04376397dc94e72fa7a13f66fca559f..a1de7d651a609963ee8550360e65588056617847 100644 (file)
@@ -79,8 +79,8 @@ public class GitBlitWebApp extends WebApplication {
                mount(new MixedParamUrlCodingStrategy("/patch", PatchPage.class, new String[] { "r", "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
+               mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "r" }));\r
+               mount(new MixedParamUrlCodingStrategy("/ticgittkt", TicGitTicketPage.class, new String[] { "r", "h", "f" }));\r
                \r
                repositories = new File(StoredSettings.getString("repositoriesFolder", "repos"));\r
                exportAll = StoredSettings.getBoolean("exportAll", true);\r
index e339232f5a434f09b590832b62773bee56ee71e4..eb74b12508b1338b59290c7817632aa25a849dbb 100644 (file)
@@ -19,7 +19,7 @@
                        <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><div wicket:id="ticketHandler">[ticket handler]</div></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
index 2a042a6da51f622f84ed1d74a9fe2e1688e50721..7a8b301efc30c328a144bef1921681c6f7236b14 100644 (file)
@@ -36,8 +36,8 @@ public class TicGitPage extends RepositoryPage {
                                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", WicketUtils.trimString(entry.handler, 30)));\r
-                               item.add(new LinkPanel("ticketTitle", null, WicketUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name)));\r
+                               item.add(new Label("ticketHandler", WicketUtils.trimString(entry.handler.toLowerCase(), 30)));\r
+                               item.add(new LinkPanel("ticketTitle", "list subject", WicketUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name)));\r
 \r
                                WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
index 174626622b7815091f87fcbb59f05f134e7f095c..aafbf8c05bd7a47b916d1b6711fe8bb3c7a152c2 100644 (file)
        <div class="header"><wicket:message key="gb.ticketComments">comments</wicket:message></div>\r
        \r
        <!-- comments -->\r
-       <table style="width:100%;" class="pretty">\r
+       <table style="width:100%;" class="comments">\r
                <tbody>\r
-                       <tr wicket:id="comment">\r
-                       <td class="date"><span wicket:id="commentDate">[comment date]</span></td>\r
-                       <td class="author"><span wicket:id="commentAuthor">[comment author]</span></td>\r
-                       <td><div wicket:id="commentText">[comment text]</div></td>\r
+                       <tr valign="top" wicket:id="comment">\r
+                       <td><span class="date" wicket:id="commentDate">[comment date]</span><br/>\r
+                       <span class="author" wicket:id="commentAuthor">[comment author]</span></td>\r
+                       <td><span wicket:id="commentText">[comment text]</span></td>\r
                        </tr>\r
                </tbody>\r
     </table>\r
index fdd6ea0a92a18d4a07b9174bd8335c203b7b4e36..73b70850480d37b60874f7773a71e3d9d5e39769 100644 (file)
@@ -8,6 +8,7 @@ import org.apache.wicket.markup.repeater.data.ListDataProvider;
 import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.utils.Utils;\r
 import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.WicketUtils;\r
@@ -26,8 +27,8 @@ public class TicGitTicketPage extends RepositoryPage {
 \r
                add(new Label("ticketTitle", t.title));\r
                add(new Label("ticketId", t.id));\r
-               add(new Label("ticketHandler", t.handler));\r
-               add(WicketUtils.createTimestampLabel("ticketOpendate", t.date, getTimeZone()));\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
@@ -41,7 +42,7 @@ public class TicGitTicketPage extends RepositoryPage {
                        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));\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
@@ -56,7 +57,8 @@ public class TicGitTicketPage extends RepositoryPage {
        }\r
 \r
        private String prepareComment(String comment) {\r
-               String html = WicketUtils.breakLines(comment).trim();\r
+               String html = Utils.escapeForHtml(comment, false);\r
+               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
index bb993508c297bd2ddf22f6fa95a8e86372624611..c5a416b9e617e3cc444f3af1a7051ff54aa31d59 100644 (file)
@@ -293,7 +293,7 @@ table.plain {
        padding: 8px;\r
 }\r
 \r
-table.pretty, table.repositories {\r
+table.pretty, table.repositories, table.comments {\r
        margin-bottom:5px;\r
        border-spacing: 0px;\r
        border-left: 1px solid #bbb;\r
@@ -304,6 +304,11 @@ table.pretty td {
        padding: 2px 4px;\r
 }\r
 \r
+table.comments td {\r
+       padding: 4px;\r
+       line-height: 17px;\r
+}\r
+\r
 table.repositories {\r
        width:100%;     \r
 }\r