summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <orbekk@pvv.ntnu.no>2010-09-04 11:17:30 -0400
committerKjetil Ørbekk <orbekk@pvv.ntnu.no>2010-09-04 11:17:30 -0400
commit6c9d6a863f0db5fa9da5bb841a8bc3024bd11f77 (patch)
tree72e0af3b78dc70a0d409958cdc9ed4a1a475dfd8
parenta75305bf103568af904028d0bc63e35056f9bc9c (diff)
Print header in ViewQuote
-rw-r--r--src/lq/Quote.java2
-rw-r--r--src/lq/ViewQuote.java19
2 files changed, 20 insertions, 1 deletions
diff --git a/src/lq/Quote.java b/src/lq/Quote.java
index 9d399fb..237f002 100644
--- a/src/lq/Quote.java
+++ b/src/lq/Quote.java
@@ -40,8 +40,8 @@ public class Quote {
@Persistent
private Integer numVotes;
+ // sum [ (rating-2.5) * abs(rating-2.5) | rating <- votes ]
@Persistent
- // sum [ (rating-3) * abs((rating-3)) | rating <- votes ]
private Double scorePoints;
public Quote(Date quoteDate, String author, String content, String ip) {
diff --git a/src/lq/ViewQuote.java b/src/lq/ViewQuote.java
index 2575523..5c40ac3 100644
--- a/src/lq/ViewQuote.java
+++ b/src/lq/ViewQuote.java
@@ -20,6 +20,8 @@ public class ViewQuote extends HttpServlet {
Quote quote = QuoteUtil.getQuoteWithId(id);
resp.setContentType("text/html");
+ resp.getWriter().println(header);
+ resp.getWriter().println("<pre><hr>");
if (quote != null) {
Printer printer = new Printer(resp.getWriter());
@@ -29,4 +31,21 @@ public class ViewQuote extends HttpServlet {
resp.getWriter().println("Quote not found.");
}
}
+
+ private final String header =
+ "<html> " +
+ "<head> " +
+ "<meta name=\"robots\" content=\"noindex, nofollow\" /> " +
+ "<title>Quotes fra #linux.no på freenode</title> " +
+ "<style type=\"text/css\"> " +
+ "body {font-family: monospace;}" +
+ "hr {" +
+ " border-style: solid;" +
+ " border-color: black;" +
+ " border-width: 1px; " +
+ "}" +
+ "</style> " +
+ "</head> " +
+ "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\"> ";
+
}