diff options
-rw-r--r-- | html/quotes.jsp | 4 | ||||
-rw-r--r-- | src/lq/Printer.java | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/html/quotes.jsp b/html/quotes.jsp index f855044..97e9daf 100644 --- a/html/quotes.jsp +++ b/html/quotes.jsp @@ -65,8 +65,10 @@ if (order == null) { } lq.Printer printer = new lq.Printer(out); +long displayIndex = quotes.size() + 1; for (lq.Quote quote : quotes) { - printer.printQuote(quote); + printer.printQuote(quote, displayIndex); + displayIndex = displayIndex - 1; } %> diff --git a/src/lq/Printer.java b/src/lq/Printer.java index beee449..14d08f9 100644 --- a/src/lq/Printer.java +++ b/src/lq/Printer.java @@ -11,9 +11,16 @@ public class Printer { } public void printQuote(Quote quote) { + printQuote(quote, null); + } + + public void printQuote(Quote quote, Long displayIndex) { + if (displayIndex == null) { + displayIndex = quote.getId(); + } out.println("<br>"); out.println("<a href=\"/view_quote?id=" + quote.getId() + "\">" + - "#" + quote.getId() + + "#" + displayIndex + "</a>"+ ", lagt til av " + Strings.escape(quote.getAuthor()) + "<br>"); |