[Fencommits] fenserve: fix
Benja Fallenstein
benja.fallenstein at gmail.com
Thu May 24 22:28:33 EEST 2007
Thu May 24 22:28:24 EEST 2007 Benja Fallenstein <benja.fallenstein at gmail.com>
* fix
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs 2007-05-24 22:28:33.000000000 +0300
+++ new-fenserve/fendata/Main.hs 2007-05-24 22:28:33.000000000 +0300
@@ -384,7 +384,8 @@
("/potion?exp=" ++ concatMap escapeMore (escape (show (subst (-1) new exp)))
++ maybe "" ("&name="++) (lookM msg "name")
, s) where
- escapeMore '[' = "%5b"; escapeMore ']' = "%5d"; escapeMore c = [c]
+ escapeMore '[' = "%5b"; escapeMore ']' = "%5d";
+ escapeMore '&' = "%26"; escapeMore c = [c]
Just exp = fmap read $ lookM msg "exp"
Just (Concat olds) = fmap read $ lookM msg "old"
Just tmp = lookM msg "template"
@@ -434,6 +435,7 @@
showTable :: () -> MyState -> (HTML, MyState)
showTable () s = (
+ makePage s "List of items in the database" "" $
(new+++) . (hr+++) . (+++new) .
catFor (Map.toList $ stateItems s) $ \(id, Item fields cats) ->
(+++ para (formP "delItem" (hidden "item" (show id) +++ mdotted
@@ -446,9 +448,9 @@
. catFor (Map.toList fields) $ \(f,v) ->
bold (capitalize f) +++ ": " +++ v +++ br,
s) where new = para . formP "newItem" . (+++ hidden "returnTo" "table")
- . (+++ " " +++ mdot +++ " " +++ link "addCategory" "[Add category]")
+ . (+++ " " +++ mdot +++ " " +++ bold (link "addCategory" "[Add category]"))
. mdotted . for (Map.keys $ stateSchema s) $ \cat ->
- button' "cat" cat $ "[New "+++cat+++"]"
+ button' "cat" cat $ bold ("[New "+++cat+++"]")
mdot = style "margin-left: 0.5em; margin-right: 0.5em; font-weight: bold" $
HTML "·"
@@ -457,6 +459,7 @@
showItem :: String -> Request -> MyState -> (HTML, MyState)
showItem item req s = let Item fields cats = stateItems s Map.! read item in (
+ makePage s "Item editor" "" $
formP "" . ((returnTo+++buttons+++hr)+++) . (+++hr+++buttons) .
catFor (Set.toList cats) $ \cat -> let cfs = stateSchema s Map.! cat in
(h3 (capitalize cat) +++) . para
@@ -504,12 +507,12 @@
h1 ("Fendata | " +++ title)) +++
tag "div" [("class", "main")] (
tag "div" [("class", "sidebar")] (
- para "Welcome to Fendata!" +++
+ para "Welcome to Fendata!" +++ sidebar +++ hr +++
catFor (stateSidebarPages state) (\exp ->
let ?state=state; ?link=False; ?name=Nothing
in para $ bold $ link ("/potion?exp="++show exp) $
- renderExp exp id string) +++
- sidebar) +++
+ renderExp exp id string) +++ hr +++
+ link "/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