X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Main.hs;fp=Main.hs;h=7e96e65396299c5e75180e240256b2a6acc432ba;hb=ab78d2448c6bb4078acfc33891e911a14c5f6445;hp=ea9316b3f68dedc03091d24ce365ea1766cc0fc9;hpb=cfd9357931f136f52df2becd0af605111e102234;p=yawbih.git diff --git a/Main.hs b/Main.hs index ea9316b..7e96e65 100644 --- a/Main.hs +++ b/Main.hs @@ -65,7 +65,7 @@ parseText full = case parse wikiParser "" full of footer db key = do hr empty table $ tr $ do - td $ submitLink0 (editPage db key) (text "Edit this page") + td $ submitLink0 (editPage db key) (text "Edit this keyword") td $ submitLink0 (listRevs db key) (text "List old versions") td $ text "Keyword: " td $ activate (showPage db) textInputField empty @@ -91,8 +91,16 @@ showRev db key id = do case s of Nothing -> text "No such revision" Just s -> parseText s + p empty + submitLink0 (changeCurrent db key id) (text "Set this version as the current one") footer db key - +changeCurrent db key id = do + b <- io $ setCurrent db key id + if b then showPage db key + else standardQuery key $ do + text "Could not set this revision as the current active one." + p empty + linkKey db key ex [] = return () ex ((Paragraph):xs) = do