put diff at end of revert form
authorJoey Hess <joey@kitenet.net>
Wed, 6 Oct 2010 18:59:20 +0000 (14:59 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 6 Oct 2010 19:00:48 +0000 (15:00 -0400)
IkiWiki/Plugin/recentchanges.pm
templates/revert.tmpl

index 948bb13..4cd9106 100644 (file)
@@ -117,8 +117,7 @@ sub sessioncgi ($$) {
        }
        else {
                $form->title(sprintf(gettext("confirm reversion of %s"), $rev));
-               my $patch_contents = IkiWiki::rcs_diff($rev);
-               $form->tmpl_param(patch_contents => encode_entities($patch_contents));
+               $form->tmpl_param(diff => encode_entities(scalar IkiWiki::rcs_diff($rev)));
                $form->field(name => "rev", type => "hidden", value => $rev, force => 1);
                IkiWiki::showform($form, $buttons, $session, $q);
                exit 0;
index 03cd083..6289bea 100644 (file)
@@ -1,6 +1,3 @@
-<pre>
-<TMPL_VAR patch_contents>
-</pre>
 <TMPL_VAR FORM-START>
 <div>
  <TMPL_VAR FIELD-DO>
@@ -8,7 +5,15 @@
  <TMPL_VAR FIELD-REV>
 </div>
 <div class="revert buttons">
- <TMPL_VAR form-submit>
- <TMPL_VAR form-cancel>
+<TMPL_VAR form-submit>
+<TMPL_VAR form-cancel>
 </div>
 <TMPL_VAR FORM-END>
+<br \>
+<div class="header">
+<span>Diff being reverted:</span>
+</div>
+<div id="diff">
+<pre>
+<TMPL_VAR diff>
+</pre>