Index: bin/edit
===================================================================
RCS file: /cvsroot/twiki/twiki/bin/edit,v
retrieving revision 1.58
diff -c -r1.58 edit
*** bin/edit	30 Oct 2002 15:52:56 -0000	1.58
--- bin/edit	9 Nov 2002 05:00:37 -0000
***************
*** 208,215 ****
--- 208,217 ----
      # Don't want to render form fields, so this after getRenderedVersion
      my %formMeta = $meta->findOne( "FORM" );
      my $form = "";
+     my $formlabel = "";
      $form = $formMeta{"name"} if( %formMeta );
      if( $form && $saveCmd ne "repRev" ) {
+        $formlabel = "Change form";
         my @fieldDefs = &TWiki::Form::getFormDef( $templateWeb, $form );
         
         if( ! @fieldDefs ) {
***************
*** 220,234 ****
         my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, @fieldDefs );
         $tmpl =~ s/%FORMFIELDS%/$formText/go;
      } elsif( $saveCmd ne "repRev" && TWiki::Prefs::getPreferencesValue( "WEBFORMS", $webName )) {
!        $form = '<table width="100%"><tr><td align="right">'
!              . &TWiki::Form::chooseFormButton( "Add form" )
!              . '</dt></tr></table>';
!        $tmpl =~ s/%FORMFIELDS%/$form/go;
      } else {
         $tmpl =~ s/%FORMFIELDS%//go;
      }
      
      $tmpl =~ s/%FORMTEMPLATE%//go; # Clear if not being used
      $tmpl =~ s/%TEXT%/$text/go;
      $tmpl =~ s|( ?) *</*nop/*>\n?|$1|gois;   # remove <nop> tags
  
--- 222,242 ----
         my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, @fieldDefs );
         $tmpl =~ s/%FORMFIELDS%/$formText/go;
      } elsif( $saveCmd ne "repRev" && TWiki::Prefs::getPreferencesValue( "WEBFORMS", $webName )) {
!        $formlabel = "Add form";
!        $tmpl =~ s/%FORMFIELDS%//go;
      } else {
         $tmpl =~ s/%FORMFIELDS%//go;
      }
      
      $tmpl =~ s/%FORMTEMPLATE%//go; # Clear if not being used
+    
+     if ($formlabel) {
+       $form = &TWiki::Form::chooseFormButton( $formlabel );
+       $tmpl =~ s/%FORMEDIT%/$form/go;
+     } else {
+       $tmpl =~ s/%FORMEDIT%//go;
+     }
+ 
      $tmpl =~ s/%TEXT%/$text/go;
      $tmpl =~ s|( ?) *</*nop/*>\n?|$1|gois;   # remove <nop> tags
  
Index: lib/TWiki/Form.pm
===================================================================
RCS file: /cvsroot/twiki/twiki/lib/TWiki/Form.pm,v
retrieving revision 1.30
diff -c -r1.30 Form.pm
*** lib/TWiki/Form.pm	5 Jun 2002 06:17:35 -0000	1.30
--- lib/TWiki/Form.pm	9 Nov 2002 05:00:38 -0000
***************
*** 223,236 ****
  {
      my( $web, $topic, $form, $meta, $query, @fieldsInfo ) = @_;
  
-     my $chooseForm = "";   
-     if( TWiki::Prefs::getPreferencesValue( "WEBFORMS", "$web" ) ) {
-         $chooseForm = chooseFormButton( "Change" );
-     }
-     
      # FIXME could do with some of this being in template
      my $text = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n   <tr>" . 
!                &link( $web, $form, "", "h", "", 2, $chooseForm ) . "</tr>\n";
                 
      fieldVars2Meta( $web, $query, $meta, "override" );
      
--- 223,231 ----
  {
      my( $web, $topic, $form, $meta, $query, @fieldsInfo ) = @_;
  
      # FIXME could do with some of this being in template
      my $text = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n   <tr>" . 
!                &link( $web, $form, "", "h", "", 2, "" ) . "</tr>\n";
                 
      fieldVars2Meta( $web, $query, $meta, "override" );
      
Index: templates/edit.iejs.tmpl
===================================================================
RCS file: /cvsroot/twiki/twiki/templates/edit.iejs.tmpl,v
retrieving revision 1.20
diff -c -r1.20 edit.iejs.tmpl
*** templates/edit.iejs.tmpl	31 May 2002 07:20:21 -0000	1.20
--- templates/edit.iejs.tmpl	9 Nov 2002 05:00:38 -0000
***************
*** 360,366 ****
  </script>
  <br />
  %FORMFIELDS%
! %TMPL:DEF{"topicaction"}% <input type="submit" value=" &nbsp; Preview Changes &nbsp; " />
    %SEP% <a class="footerlink" href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END%
  %TMPL:P{"standardfooter"}%
  <table width="100%" border="0" cellpadding="3" cellspacing="0">
--- 360,366 ----
  </script>
  <br />
  %FORMFIELDS%
! %TMPL:DEF{"topicaction"}% <input type="submit" value=" &nbsp; Preview Changes &nbsp; " /> %FORMEDIT%
    %SEP% <a class="footerlink" href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END%
  %TMPL:P{"standardfooter"}%
  <table width="100%" border="0" cellpadding="3" cellspacing="0">
Index: templates/edit.tmpl
===================================================================
RCS file: /cvsroot/twiki/twiki/templates/edit.tmpl,v
retrieving revision 1.29
diff -c -r1.29 edit.tmpl
*** templates/edit.tmpl	31 May 2002 07:20:21 -0000	1.29
--- templates/edit.tmpl	9 Nov 2002 05:00:38 -0000
***************
*** 56,62 ****
  <br /> <b>-- <nop>%WIKIUSERNAME% - %DATE%</b> &nbsp;&nbsp;<code>&lt;==</code> 
  This is your signature for easy copy & paste operation
  <br /> %FORMFIELDS%
! %TMPL:DEF{"topicaction"}% <input type="submit" value=" &nbsp; Preview Changes &nbsp; " />
    %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END%
  %TMPL:P{"standardfooter"}%
  <table width="100%" border="0" cellpadding="3" cellspacing="0">
--- 56,62 ----
  <br /> <b>-- <nop>%WIKIUSERNAME% - %DATE%</b> &nbsp;&nbsp;<code>&lt;==</code> 
  This is your signature for easy copy & paste operation
  <br /> %FORMFIELDS%
! %TMPL:DEF{"topicaction"}% <input type="submit" value=" &nbsp; Preview Changes &nbsp; " /> %FORMEDIT%
    %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END%
  %TMPL:P{"standardfooter"}%
  <table width="100%" border="0" cellpadding="3" cellspacing="0">
