James Moger
2011-04-13 61b094152515532b42aa5e918f5405d82cde0440
src/com/gitblit/wicket/pages/TicGitTicketPage.java
@@ -8,6 +8,7 @@
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 @@
      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 void populateItem(final Item<Comment> 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 @@
   }
   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", "<a href=\"/commit/" + repositoryName + "/$1\">commit $1</a>");
   }
}