]> ruin.nu Git - yawbih.git/commitdiff
Possible to revert to old versions
authorMichael Andreen <harv@ruin.nu>
Sat, 11 Dec 2004 16:02:31 +0000 (16:02 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 26 Jan 2008 11:33:16 +0000 (12:33 +0100)
Main.hs

diff --git a/Main.hs b/Main.hs
index ea9316b3f68dedc03091d24ce365ea1766cc0fc9..7e96e65396299c5e75180e240256b2a6acc432ba 100644 (file)
--- 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