[Fencommits] fenserve: formatting

Benja Fallenstein benja.fallenstein at gmail.com
Thu May 24 19:01:51 EEST 2007


Thu May 24 19:01:44 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * formatting
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-05-24 19:01:50.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-05-24 19:01:50.000000000 +0300
@@ -29,6 +29,15 @@
          \span.editPotion:hover span.editPotion:hover span.editPotion:hover { background: #ccc } \
          \span.editPotion:hover span.editPotion:hover span.editPotion:hover { background: #bbb } \
          \span.editPotion:hover span.editPotion:hover span.editPotion:hover span.editPotion:hover { background: #aaa } \
+         \.footer { font-size: small; font-style:italic; color: #888; \
+         \          padding-top: 2em; clear: both; text-align: justify } \
+         \.logo {border: 2px solid #eee; margin: 0.5em; float: left} \
+         \.header {border: 1px solid white; margin-bottom: 2em; clear: both} \
+         \h1 {border-bottom: 1px solid black} \
+         \body {margin-left: 100px; margin-right: 100px} \
+         \.content {float: right; width: 80% } \
+         \.sidebar {float: left; width: 15%; font-size: small } \
+         \h1, h2, h3, h4, h5, h6 { font-family: sans-serif } \
          \</style></head>"
 
 type Id = Int
@@ -305,6 +314,7 @@
         Left e -> respond $ ("", "Internal server error: " ++ show e)
 
 potionGet exp args name s = (let ?state=s; ?link=True; ?name=name in 
+                        makePage "Potion" $
                         renderExp exp id string +++ " " +++ lnk +++ hr
                     +++ if (isComplete exp)
                         then (HTML $ head $ evalStateT (runExp env exp) s)
@@ -468,6 +478,23 @@
 delItem msg s = ("table", s') where
     s' = s { stateItems = Map.delete id $ stateItems s }
     Just id = fmap read $ lookM msg "item"
+    
+makePage title body =
+    (tag "title" [] title +++) . tag "body" [] $
+    tag "div" [("class", "header")]
+      (etag "img" [("src", "http://flowerpot.kaijanaho.fi/~benja/tmp/logo.jpg"),
+                   ("class", "logo")] +++
+       h1 ("Fendata: " +++ title)) +++
+    tag "div" [("class", "main")] (
+        tag "div" [("class", "sidebar")] "Welcome to Fendata! The sidebar is empty so far." +++
+        tag "div" [("class", "content")] body) +++
+    tag "div" [("class", "footer")]
+        ("Fendata (c) 2007 by Benja Fallenstein and Tuukka Hastrup. " +++
+         link "http://www.flickr.com/photo_zoom.gne?id=244815014&size=sq" "Logo" +++
+         " (c) 2006 by " +++ link "http://www.flickr.com/photos/44458147@N00/"
+         "The G-tastic 7" +++ ". All content is licensed under the " +++
+         link "http://creativecommons.org/licenses/by-sa/2.0/" 
+         "Creative Commons Attribution-ShareAlike 2.0 license" +++ ".")
 
 main = stdHTTP [ debugFilter
                , h ["potion"] GET $ ok $ \() -> run $ 




More information about the Fencommits mailing list