Browse files

Moved things around a bit

  • Loading branch information...
1 parent 23c9baf commit a42ff507fee9e45feda8331283cd803f19c08733 @Palmik committed Apr 14, 2011
Showing with 55 additions and 10 deletions.
  1. +31 −0 log/access.log
  2. +6 −0 log/error.log
  3. +7 −7 resources/templates/index.tpl
  4. +0 −1 resources/templates/pastes.tpl
  5. +2 −2 src/Model/Paste.hs
  6. +9 −0 src/Site.hs
View
31 log/access.log
@@ -640,3 +640,34 @@
127.0.0.1 - - [14/Apr/2011:09:49:24 +0200] "GET /paste/4d8f290c-900faa2121000000 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 - - [14/Apr/2011:09:49:24 +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 - - [14/Apr/2011:09:49:26 +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 - - [14/Apr/2011:20:39:54 +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 - - [14/Apr/2011:20:39:54 +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 - - [14/Apr/2011:20:39:54 +0200] "GET /pastes 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 - - [14/Apr/2011:20:39:54 +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 - - [14/Apr/2011:20:39: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 - - [14/Apr/2011:20:40:00 +0200] "GET /pastes 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 - - [14/Apr/2011:20:40: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 - - [14/Apr/2011:20:40:00 +0200] "GET /paste/4da31414-900faa17c6000000 HTTP/1.1" 200 - "http://0.0.0.0:8000/pastes" "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 - - [14/Apr/2011:20:40: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 - - [14/Apr/2011:20:40:08 +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 - - [14/Apr/2011:20:40:10 +0200] "GET /paste/4da31414-900faa17c6000000 HTTP/1.1" 200 - "http://0.0.0.0:8000/pastes" "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 - - [14/Apr/2011:20:40:10 +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 - - [14/Apr/2011:20:40:10 +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 - - [14/Apr/2011:20:40:12 +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 - - [14/Apr/2011:20:40:14 +0200] "GET /pastes 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 - - [14/Apr/2011:20:40:14 +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 - - [14/Apr/2011:20:40:18 +0200] "GET /pastes 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 - - [14/Apr/2011:20:40: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 - - [14/Apr/2011:20:40:27 +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 - - [14/Apr/2011:20:41:07 +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 - - [14/Apr/2011:20:41:07 +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 - - [14/Apr/2011:20:41:09 +0200] "GET /pastes 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 - - [14/Apr/2011:20:41:09 +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 - - [14/Apr/2011:20:41:09 +0200] "GET /paste/4da31414-900faa17c6000000 HTTP/1.1" 200 - "http://0.0.0.0:8000/pastes" "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 - - [14/Apr/2011:20:41:09 +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 - - [14/Apr/2011:20:41:11 +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 - - [14/Apr/2011:20:41:11 +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 - - [14/Apr/2011:20:41:15 +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 - - [14/Apr/2011:20:41:15 +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 - - [14/Apr/2011:20:41:20 +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 - - [14/Apr/2011:20:41:20 +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
6 log/error.log
@@ -217,3 +217,9 @@
[14/Apr/2011:09:49:09 +0200] Server.httpServe: START (EventLoopSimple)
[14/Apr/2011:20:15:12 +0200] Server.httpServe: SHUTDOWN
[14/Apr/2011:20:15:12 +0200] Server.httpServe: BACKEND STOPPED
+[14/Apr/2011:20:39:48 +0200] Server.httpServe: START (EventLoopSimple)
+[14/Apr/2011:20:41:17 +0200] Server.httpServe: SHUTDOWN
+[14/Apr/2011:20:41:17 +0200] Server.httpServe: BACKEND STOPPED
+[14/Apr/2011:20:41:18 +0200] Server.httpServe: START (EventLoopSimple)
+[14/Apr/2011:20:41:28 +0200] Server.httpServe: SHUTDOWN
+[14/Apr/2011:20:41:28 +0200] Server.httpServe: BACKEND STOPPED
View
14 resources/templates/index.tpl
@@ -1,9 +1,9 @@
<html>
- <head>
- <title>Snap web server</title>
- <link rel="stylesheet" type="text/css" href="screen.css"/>
- </head>
- <body>
-
- </body>
+ <head>
+ <title>Echo Page</title>
+ </head>
+ <body>
+ <a href="/pastes">Recent pastes</a>
+ <apply template="add-paste-form"/>
+ </body>
</html>
View
1 resources/templates/pastes.tpl
@@ -3,7 +3,6 @@
<title>Echo Page</title>
</head>
<body>
- <apply template="add-paste-form"/>
<div id="recent-pastes">
<recent-pastes>
<apply template="full-paste"/>
View
4 src/Model/Paste.hs
@@ -45,15 +45,15 @@ paste t c d l = Paste (RecKey Nothing) t c d l
getRecentPastes :: Application [Paste]
getRecentPastes = do
- res <- withDB $ rest =<< (find (select [] "pastes") {sort = ["$natural" =: (-1 :: Int)]})
+ res <- withDB $ rest =<< (find (select [] pastesTable) {sort = ["$natural" =: (-1 :: Int)]})
return $ either (const []) (fromDocList) res
pasteIDText :: Paste -> Maybe Text
pasteIDText p = maybe Nothing (Just . T.decodeUtf8 . objid2bs) (unRK $ pasteID p)
getPaste :: ObjectId -> Application (Maybe Paste)
getPaste pid = do
- res <- withDB $ findOne (select ["_id" =: pid] "pastes")
+ res <- withDB $ findOne (select ["_id" =: pid] pastesTable)
return $ either (const Nothing) (maybe Nothing fromDoc) res
insertPaste :: Paste -> Application ()
View
9 src/Site.hs
@@ -28,6 +28,15 @@ import Text.Templating.Heist
import Application
import Controller.Paste
+
+------------------------------------------------------------------------------
+-- | Render index page
+index :: Application ()
+index = ifTop $ heistLocal (bindSplices indexSplices) $ render "index"
+ where
+ indexSplices =
+ [ ("possible-languages", possibleLanguagesSplice)
+ ]
------------------------------------------------------------------------------
-- | Render recent pastes
pastes :: Application ()

0 comments on commit a42ff50

Please sign in to comment.