From 505f176b0b23fd5c21bb37cfc3a5d063ee6219b5 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 3 Sep 2010 18:05:18 -0400 Subject: Refactor quote formatting code. --- html/quotes.jsp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'html') diff --git a/html/quotes.jsp b/html/quotes.jsp index aac4cad..6177673 100644 --- a/html/quotes.jsp +++ b/html/quotes.jsp @@ -63,31 +63,9 @@ if (order == null) { quotes = lq.QuoteUtil.getQuotesOrderedByIdDesc(); } +lq.Printer printer = new lq.Printer(out); for (lq.Quote quote : quotes) { - out.println("
"); - out.println("" + - "#" + quote.getId() + - ""+ - ", lagt til av " + lq.Strings.escape(quote.getAuthor()) + "
"); - - String score = quote.getScore().toString(); - String date = lq.DateUtil.dateFormat.format(quote.getQuoteDate()); - out.println("Dato: " + date + ", Score: "); - out.println(""); - out.println((score==null?"-":(score+ " (fra " + quote.getVotes().size() +")"))); - out.println("
Vote: "); - for(int nv=1; nv<=5; nv++) - out.println(""+nv+" "); - out.println("
"); - - out.println("

"); - out.println(); - String content = lq.Strings.escape(quote.getContent()); - out.println(content - .replaceAll("(http://[^ \r\n]+)","$1") - .replaceAll("\n","
\n")); - out.println(""); - out.println("
"); + printer.printQuote(quote); } %> -- cgit v1.2.3