From 61b094152515532b42aa5e918f5405d82cde0440 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 13 Apr 2011 16:27:17 -0400 Subject: [PATCH] Fixed ticgit pages. --- src/com/gitblit/wicket/GitBlitWebApp.java | 4 ++-- src/com/gitblit/wicket/pages/TicGitPage.html | 2 +- src/com/gitblit/wicket/pages/TicGitPage.java | 4 ++-- src/com/gitblit/wicket/pages/TicGitTicketPage.html | 10 +++++----- src/com/gitblit/wicket/pages/TicGitTicketPage.java | 10 ++++++---- src/com/gitblit/wicket/resources/gitblit.css | 7 ++++++- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/com/gitblit/wicket/GitBlitWebApp.java b/src/com/gitblit/wicket/GitBlitWebApp.java index b869a05f..a1de7d65 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.java +++ b/src/com/gitblit/wicket/GitBlitWebApp.java @@ -79,8 +79,8 @@ public class GitBlitWebApp extends WebApplication { mount(new MixedParamUrlCodingStrategy("/patch", PatchPage.class, new String[] { "r", "h", "f" })); // setup extended urls - mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "p" })); - mount(new MixedParamUrlCodingStrategy("/ticgittkt", TicGitTicketPage.class, new String[] { "p", "f" })); + mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "r" })); + mount(new MixedParamUrlCodingStrategy("/ticgittkt", TicGitTicketPage.class, new String[] { "r", "h", "f" })); repositories = new File(StoredSettings.getString("repositoriesFolder", "repos")); exportAll = StoredSettings.getBoolean("exportAll", true); diff --git a/src/com/gitblit/wicket/pages/TicGitPage.html b/src/com/gitblit/wicket/pages/TicGitPage.html index e339232f..eb74b125 100644 --- a/src/com/gitblit/wicket/pages/TicGitPage.html +++ b/src/com/gitblit/wicket/pages/TicGitPage.html @@ -19,7 +19,7 @@
[ticket state]
[ticket date] -
[ticket handler]
+
[ticket handler]
[ticket title]
diff --git a/src/com/gitblit/wicket/pages/TicGitPage.java b/src/com/gitblit/wicket/pages/TicGitPage.java index 2a042a6d..7a8b301e 100644 --- a/src/com/gitblit/wicket/pages/TicGitPage.java +++ b/src/com/gitblit/wicket/pages/TicGitPage.java @@ -36,8 +36,8 @@ public class TicGitPage extends RepositoryPage { WicketUtils.setTicketCssClass(stateLabel, entry.state); item.add(stateLabel); item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession.get().getTimezone())); - item.add(new Label("ticketHandler", WicketUtils.trimString(entry.handler, 30))); - item.add(new LinkPanel("ticketTitle", null, WicketUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name))); + item.add(new Label("ticketHandler", WicketUtils.trimString(entry.handler.toLowerCase(), 30))); + item.add(new LinkPanel("ticketTitle", "list subject", WicketUtils.trimString(entry.title, 80), TicGitTicketPage.class, newPathParameter(entry.name))); WicketUtils.setAlternatingBackground(item, counter); counter++; diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.html b/src/com/gitblit/wicket/pages/TicGitTicketPage.html index 17462662..aafbf8c0 100644 --- a/src/com/gitblit/wicket/pages/TicGitTicketPage.html +++ b/src/com/gitblit/wicket/pages/TicGitTicketPage.html @@ -26,12 +26,12 @@
comments
- +
- - - - + + +
[comment date][comment author]
[comment text]
[comment date]
+ [comment author]
[comment text]
diff --git a/src/com/gitblit/wicket/pages/TicGitTicketPage.java b/src/com/gitblit/wicket/pages/TicGitTicketPage.java index fdd6ea0a..73b70850 100644 --- a/src/com/gitblit/wicket/pages/TicGitTicketPage.java +++ b/src/com/gitblit/wicket/pages/TicGitTicketPage.java @@ -8,6 +8,7 @@ import org.apache.wicket.markup.repeater.data.ListDataProvider; import org.eclipse.jgit.lib.Repository; import com.gitblit.utils.JGitUtils; +import com.gitblit.utils.Utils; import com.gitblit.wicket.GitBlitWebSession; import com.gitblit.wicket.RepositoryPage; import com.gitblit.wicket.WicketUtils; @@ -26,8 +27,8 @@ public class TicGitTicketPage extends RepositoryPage { add(new Label("ticketTitle", t.title)); add(new Label("ticketId", t.id)); - add(new Label("ticketHandler", t.handler)); - add(WicketUtils.createTimestampLabel("ticketOpendate", t.date, getTimeZone())); + add(new Label("ticketHandler", t.handler.toLowerCase())); + add(WicketUtils.createTimestampLabel("ticketOpenDate", t.date, getTimeZone())); Label stateLabel = new Label("ticketState", t.state); WicketUtils.setTicketCssClass(stateLabel, t.state); add(stateLabel); @@ -41,7 +42,7 @@ public class TicGitTicketPage extends RepositoryPage { public void populateItem(final Item item) { final Comment entry = item.getModelObject(); item.add(WicketUtils.createDateLabel("commentDate", entry.date, GitBlitWebSession.get().getTimezone())); - item.add(new Label("commentAuthor", entry.author)); + item.add(new Label("commentAuthor", entry.author.toLowerCase())); item.add(new Label("commentText", prepareComment(entry.text)).setEscapeModelStrings(false)); WicketUtils.setAlternatingBackground(item, counter); counter++; @@ -56,7 +57,8 @@ public class TicGitTicketPage extends RepositoryPage { } private String prepareComment(String comment) { - String html = WicketUtils.breakLines(comment).trim(); + String html = Utils.escapeForHtml(comment, false); + html = WicketUtils.breakLines(comment).trim(); return html.replaceAll("\\bcommit\\s*([A-Za-z0-9]*)\\b", "commit $1"); } } diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css index bb993508..c5a416b9 100644 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ b/src/com/gitblit/wicket/resources/gitblit.css @@ -293,7 +293,7 @@ table.plain { padding: 8px; } -table.pretty, table.repositories { +table.pretty, table.repositories, table.comments { margin-bottom:5px; border-spacing: 0px; border-left: 1px solid #bbb; @@ -304,6 +304,11 @@ table.pretty td { padding: 2px 4px; } +table.comments td { + padding: 4px; + line-height: 17px; +} + table.repositories { width:100%; } -- 2.39.5