| | |
| | | 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;
|
| | |
| | |
|
| | | 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);
|
| | |
| | | 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++;
|
| | |
| | | }
|
| | |
|
| | | 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>");
|
| | | }
|
| | | }
|