Skip to content
Browse files

Some work on sigle paste rendering

  • Loading branch information...
1 parent 79593c2 commit fb9bf146869026c3e0667d63f872b26eba61fd14 @Palmik committed Apr 6, 2011
Showing with 119 additions and 15 deletions.
  1. +66 −0 log/access.log
  2. +32 −0 log/error.log
  3. +1 −8 resources/templates/pastes.tpl
  4. +4 −5 src/Controller/Paste.hs
  5. +16 −2 src/Site.hs
View
66 log/access.log
@@ -407,3 +407,69 @@
127.0.0.1 - - [27/Mar/2011:21:17:53 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
127.0.0.1 - - [27/Mar/2011:22:31:18 +0200] "GET / HTTP/1.1" 200 - "http://0.0.0.0:8000/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
127.0.0.1 - - [27/Mar/2011:22:31:18 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:21 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:21 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:21 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:21 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:59 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:21:59 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:01 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:01 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:05 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:05 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:31 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:31 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:37 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:22:37 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:23:16 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:23:16 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:24:31 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:24:31 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:27:39 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:27:39 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:34 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:34 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:40 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:40 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:40 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:40 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:42 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:42 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:44 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:20:29:44 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:21:39:36 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:21:39:36 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:21:52:32 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:21:52:32 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:22:30:03 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [28/Mar/2011:22:30:03 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:53:00 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:53:00 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:53:04 +0200] "GET /paste/id HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:53:04 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:54:16 +0200] "GET /paste/4d8f290c900faa2121000000 HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:54:16 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:54:18 +0200] "GET /paste/4d8f290c900faa2121000000 HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:21:54:18 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:01:30 +0200] "GET /paste/4d8f290c900faa2121000000 HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:01:30 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:28 +0200] "GET /paste/4d8f290c900faa2121000000 HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:28 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:28 +0200] "GET /paste/4d8f290c900faa2121000000 HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:28 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:58 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:06:58 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:00 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:00 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:07:02 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:08:59 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:08:59 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:08:59 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:08:59 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:20:19 +0200] "GET /paste/awdawd HTTP/1.1" 500 67 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
+127.0.0.1 - - [29/Mar/2011:22:20:19 +0200] "GET /favicon.ico HTTP/1.1" 404 3 - "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
View
32 log/error.log
@@ -104,3 +104,35 @@
[27/Mar/2011:21:11:13 +0200] Server.httpServe: SHUTDOWN
[27/Mar/2011:21:11:13 +0200] Server.httpServe: BACKEND STOPPED
[27/Mar/2011:21:11:15 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:21:17 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:21:56 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:21:56 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:21:59 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:22:35 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:22:35 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:22:37 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:23:14 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:23:14 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:23:16 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:24:31 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:24:31 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:24:31 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:27:37 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:27:37 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:27:37 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:20:29:36 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:20:29:36 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:20:29:38 +0200] Server.httpServe: START (EventLoopSimple)
+[28/Mar/2011:21:39:31 +0200] Server.httpServe: SHUTDOWN
+[28/Mar/2011:21:39:31 +0200] Server.httpServe: BACKEND STOPPED
+[28/Mar/2011:21:39:31 +0200] Server.httpServe: START (EventLoopSimple)
+[29/Mar/2011:21:46:55 +0200] Server.httpServe: START (EventLoopSimple)
+[29/Mar/2011:21:52:36 +0200] Server.httpServe: SHUTDOWN
+[29/Mar/2011:21:52:36 +0200] Server.httpServe: BACKEND STOPPED
+[29/Mar/2011:21:52:38 +0200] Server.httpServe: START (EventLoopSimple)
+[29/Mar/2011:22:06:21 +0200] Server.httpServe: SHUTDOWN
+[29/Mar/2011:22:06:21 +0200] Server.httpServe: BACKEND STOPPED
+[29/Mar/2011:22:06:22 +0200] Server.httpServe: START (EventLoopSimple)
+[29/Mar/2011:22:08:56 +0200] Server.httpServe: SHUTDOWN
+[29/Mar/2011:22:08:56 +0200] Server.httpServe: BACKEND STOPPED
+[29/Mar/2011:22:08:57 +0200] Server.httpServe: START (EventLoopSimple)
View
9 resources/templates/pastes.tpl
@@ -3,11 +3,7 @@
<title>Echo Page</title>
</head>
<body>
- <apply template="add-paste-form">
- <bind tag="possible-languages">
- <possible-languages/>
- </bind>
- </apply>
+ <apply template="add-paste-form"/>
<div id="recent-pastes">
<recent-pastes>
<apply template="full-paste">
@@ -18,8 +14,5 @@
</apply>
</recent-pastes>
</div>
- <possible-languages>
- <option value="$(lang-value)"><lang-name/></option>
- </possible-languages>
</body>
</html>
View
9 src/Controller/Paste.hs
@@ -28,16 +28,14 @@ import Model.Paste
languageParts :: (Text, Text) -> [(Text, Text)]
-languageParts (n, v) = [ ("lang-name", n), ("lang-value", v) ]
+languageParts (n, v) = [("lang-name", n), ("lang-value", v)]
possibleLanguages :: [(Text, Text)]
-possibleLanguages = [ ("C++", "cpp")
+possibleLanguages = [ ("C++", "cpp")
, ("Haskell", "hs") ]
possibleLanguagesSplice :: Splice Application
-possibleLanguagesSplice = do
- pl <- return possibleLanguages
- mapSplices (runChildrenWithText . languageParts) pl
+possibleLanguagesSplice = mapSplices (runChildrenWithText . languageParts) possibleLanguages
pasteParts :: Paste -> [(Text, Text)]
pasteParts p = map applyAndPack [ ("title", pasteTitle)
@@ -52,6 +50,7 @@ singlePasteSplice pid = do
case mp of
Nothing -> (return . (:[]) . X.TextNode) "404"
Just p -> runChildrenWithText $ pasteParts p
+
recentPastesSplice :: Splice Application
View
18 src/Site.hs
@@ -12,8 +12,13 @@ module Site
) where
import Control.Applicative
+import Control.Monad
+import Debug.Trace
+import Control.Monad.Trans
import Data.Maybe
import qualified Data.Text.Encoding as T
+
+import Snap.Extension.DB.MongoDB (bs2objid)
import Snap.Extension.Heist
import Snap.Extension.Timer
import Snap.Util.FileServe
@@ -35,12 +40,21 @@ pastes = ifTop $ heistLocal (bindSplices pastesSplices) $ render "pastes"
------------------------------------------------------------------------------
-- | Render single paste
-
+paste :: Application ()
+paste = do
+ oid <- liftM bs2objid $ decodedParam "oid"
+ let pasteSplices = [ ("single-paste", singlePasteSplice oid)
+ , ("possible-languages", possibleLanguagesSplice)
+ ]
+ ifTop $ heistLocal (bindSplices pasteSplices) $ render "paste"
+ where
+ decodedParam p = fromMaybe "" <$> getParam p
+
------------------------------------------------------------------------------
-- | The main entry point handler.
site :: Application ()
site = route [ ("/", methods [GET, HEAD] pastes)
, ("/", method POST addPasteHandler)
- --, ("/paste/:pid" singlePaste)
+ , ("/paste/:oid", paste)
]
<|> serveDirectory "resources/static"

0 comments on commit fb9bf14

Please sign in to comment.
Something went wrong with that request. Please try again.