From: Michael Andreen Date: Sat, 11 Dec 2004 16:02:31 +0000 (+0000) Subject: Possible to revert to old versions X-Git-Url: https://ruin.nu/git/?p=yawbih.git;a=commitdiff_plain;h=ab78d2448c6bb4078acfc33891e911a14c5f6445 Possible to revert to old versions --- 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