[Fencommits] fenserve: twid formatting

Benja Fallenstein benja.fallenstein at gmail.com
Sat Apr 28 17:25:06 EEST 2007


Sat Apr 28 17:24:57 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * twid formatting
diff -rN -u old-fenserve/notetaker/Main.hs new-fenserve/notetaker/Main.hs
--- old-fenserve/notetaker/Main.hs	2007-04-28 17:25:05.000000000 +0300
+++ new-fenserve/notetaker/Main.hs	2007-04-28 17:25:05.000000000 +0300
@@ -45,19 +45,20 @@
     let Note title _ notes =
             getPath path $ foldl (flip execute) (Note "HOME" True []) lines
     respond $ style ++ "<h2>" ++ renderPath path ++ " " ++ title ++ "</h2>"
-           ++ renderNotes path notes ++ views 0 nick ++ form nick
+           ++ renderNotes path nick notes ++ views 0 nick ++ form nick
            
 getPath [] note = note
 getPath (i:is) (Note _ _ cs) = getPath is (cs !! i)
                     
-renderNotes p notes = 
+renderNotes p nick notes = 
     "<ol>" ++ concat [renderNote (p++[i]) (notes !! i) 
                      | i <- [0..length notes - 1]] ++ "</ol>" where
     
-    renderNote p (Note title False cs) = "<li>" ++ title ++ renderNotes p cs
+    renderNote p (Note title False cs) = "<li>" ++ title ++ renderNotes p nick cs
     renderNote p (Note title True cs) =
-        "<li><a href='/item/"++renderPath p++"'><b>Page</b></a> ("
-      ++show (length cs)++"): "++title
+         "<li>" ++ title ++ " (<a href='/item/"
+      ++ renderPath p ++ "?nick=" ++ nick ++ "'><i>"
+      ++ show (length cs) ++ " children</i></a>)"
     
 readPath :: String -> Path
 readPath s = readPath' s 0 (\p _ -> p)




More information about the Fencommits mailing list