fix pagediff to not display as "preview"
authorJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 02:19:14 +0000 (22:19 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 02:19:14 +0000 (22:19 -0400)
I think originally, the page preview header was not displayed,
so diff was hacked in using it.

IkiWiki/Plugin/editdiff.pm
templates/editpage.tmpl

index d8f53a42ee6031b072dab134ec6c6740c156be3c..015ce9c148d554c29a3db6a04227a2a50c88f02e 100644 (file)
@@ -71,7 +71,7 @@ sub formbuilder_setup {
                $content=~s/\r/\n/g;
 
                my $diff = diff(srcfile($pagesources{$page}), $content);
                $content=~s/\r/\n/g;
 
                my $diff = diff(srcfile($pagesources{$page}), $content);
-               $form->tmpl_param("page_preview", $diff);
+               $form->tmpl_param("page_diff", $diff);
        }
 }
 
        }
 }
 
index 1e2d070ed530601fcf7967571e2053d39a553c73..118ca455046ad414f1e41366d7fbb16b33e984e4 100644 (file)
 <TMPL_VAR PAGE_PREVIEW>
 </div>
 </TMPL_IF>
 <TMPL_VAR PAGE_PREVIEW>
 </div>
 </TMPL_IF>
+<TMPL_IF NAME="PAGE_DIFF">
+<hr />
+<div class="header">
+<span>Diff:</span>
+</div>
+<div id="diff">
+<TMPL_VAR PAGE_DIFF>
+</div>
+</TMPL_IF>