]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add cencel link to edit page
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 12 Mar 2006 20:45:36 +0000 (20:45 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 12 Mar 2006 20:45:36 +0000 (20:45 +0000)
ikiwiki

diff --git a/ikiwiki b/ikiwiki
index 7fae07eee1b348611822cd2f6d6ee84e67a9ef90..a6860f2486dc1bd197ac8a0ea073e30f14819c4e 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -942,6 +942,10 @@ sub cgi_editpage ($$) { #{{{
        $form->field(name => "content", type => "textarea", rows => 20,
                cols => 80);
        
+       if ($form->submitted eq "Cancel") {
+               print $q->redirect("$url/".htmlpage($page));
+               return;
+       }
        if (! $form->submitted || ! $form->validate) {
                if ($form->field("do") eq "create") {
                        if (exists $pagesources{lc($page)}) {
@@ -989,7 +993,7 @@ sub cgi_editpage ($$) { #{{{
                
                $form->tmpl_param("can_commit", $svn);
                $form->tmpl_param("indexlink", indexlink());
-               print $form->render(submit => ["Save Page"]);
+               print $form->render(submit => ["Save Page", "Cancel"]);
        }
        else {
                # save page