[Fencommits] fenserve: twids, fixes

Benja Fallenstein benja.fallenstein at gmail.com
Fri May 25 18:53:39 EEST 2007


Fri May 25 18:53:22 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * twids, fixes
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-05-25 18:53:39.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-05-25 18:53:39.000000000 +0300
@@ -41,11 +41,11 @@
         ])
         [Call "Blog_post_archive" []]
 
-potion = Forall (catType "post") 0 (Just $ AllItems "post") $ Just $
+potion = Concat [Just $ Forall (catType "post") 0 (Just $ AllItems "post") $ Just $
     Concat (map Just [Str "<h2>", Field "post" "title" v, Str "</h2>",
                     Str "\n<p>Author: ", Field "post" "author" v,
                     Str "\n<p>", Field "post" "body" v,
-                    Str "\n<hr>"])
+                    Str "\n<hr>"])]
     where v = Just $ Var 0
 
 readArgs :: Request -> [Value]
diff -rN -u old-fenserve/fendata/PotionTypes.hs new-fenserve/fendata/PotionTypes.hs
--- old-fenserve/fendata/PotionTypes.hs	2007-05-25 18:53:39.000000000 +0300
+++ new-fenserve/fendata/PotionTypes.hs	2007-05-25 18:53:39.000000000 +0300
@@ -13,8 +13,10 @@
 type Category = String
 type Field = String
 
-data Type = Type { typeQuestion :: String }
+data Type = Type String
     deriving (Read, Show, Typeable, Data, Eq, Ord)
+    
+typeQuestion (Type s) = s
 
 data Fun = Fun [Type] [HTML] Exp
     deriving (Read, Show, Typeable, Data, Eq, Ord)
diff -rN -u old-fenserve/fendata/Potions.hs new-fenserve/fendata/Potions.hs
--- old-fenserve/fendata/Potions.hs	2007-05-25 18:53:39.000000000 +0300
+++ new-fenserve/fendata/Potions.hs	2007-05-25 18:53:39.000000000 +0300
@@ -66,7 +66,7 @@
     f []     [x]    _      n = editLink cx exp ty x
     f (t:ts) (x:xs) (y:ys) n = 
         editLink cx exp ty x +++ renderMaybeExp' y (cx' n) t +++ f ts xs ys (n+1)
-renderExp e0@(Field cat field exp) cx ty = editLink cx e0 ty ("the " +++ field +++ " of ") +++ renderMaybeExp' exp (\e -> Field cat field $ Just e) (catType cat) where
+renderExp e0@(Field cat field exp) cx ty = editLink cx e0 ty ("the " +++ field +++ " of ") +++ renderMaybeExp' exp (\e -> cx $ Field cat field $ Just e) (catType cat) where
 renderExp e0@(AllItems cat) cx ty = editLink cx e0 ty ("all the "++cat++"s in the system")
 renderExp exp@(Var i) cx ty = editLink cx exp ty (renderVar i)
 renderExp e0@(Forall t i exp body) cx _ = editLink cx e0 string "For each of " +++ renderMaybeExp' exp (\e -> cx $ Forall t i (Just e) body) t
diff -rN -u old-fenserve/fendata/UI.hs new-fenserve/fendata/UI.hs
--- old-fenserve/fendata/UI.hs	2007-05-25 18:53:39.000000000 +0300
+++ new-fenserve/fendata/UI.hs	2007-05-25 18:53:39.000000000 +0300
@@ -44,7 +44,8 @@
                 let ?state=state; ?link=False; ?name=Nothing
                  in para $ bold $ link (?root++"potion?exp="++escape' (show exp)) $
                     renderExp exp id string) +++ hr +++
-            link (?root++"table") "List of items in the database") +++
+            para (link (?root++"potion?exp="++(escape' $ show $ Concat [])) "New page") +++
+            para (link (?root++"table") "List of items in the database")) +++
         tag "div" [("class", "content")] body) +++
     tag "div" [("class", "footer")]
         ("Fendata (c) 2007 by Benja Fallenstein and Tuukka Hastrup. " +++




More information about the Fencommits mailing list