attachment: Support adding attachments to pages even as they are being created.
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 2 Oct 2008 16:48:06 +0000 (12:48 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 2 Oct 2008 16:48:06 +0000 (12:48 -0400)
IkiWiki/Plugin/attachment.pm
debian/changelog

index 8379928418fd997922a574bc59f68c79415251d4..2d1fe51cf090b0f70595104217bd8d01b34ab0f9 100644 (file)
@@ -94,7 +94,8 @@ sub formbuilder_setup (@) { #{{{
        my $form=$params{form};
        my $q=$params{cgi};
 
-       if (defined $form->field("do") && $form->field("do") eq "edit") {
+       if (defined $form->field("do") && ($form->field("do") eq "edit" ||
+           $form->field("do") eq "create")) {
                # Add attachment field, set type to multipart.
                $form->enctype(&CGI::MULTIPART);
                $form->field(name => 'attachment', type => 'file');
@@ -158,7 +159,7 @@ sub formbuilder (@) { #{{{
        my $form=$params{form};
        my $q=$params{cgi};
 
-       return if ! defined $form->field("do") || $form->field("do") ne "edit";
+       return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ;
 
        my $filename=$q->param('attachment');
        if (defined $filename && length $filename &&
index 6c6eea205dd061dfe00c8cda79830d5056a047a6..b54fce7848115943758c1135dfbb9421f1477f08 100644 (file)
@@ -33,6 +33,8 @@ ikiwiki (2.66) UNRELEASED; urgency=low
   * httpauth: Document that ikiwiki.cgi has to be in a directory subject to
     authentication. Closes: #500524 
   * inline: Fix handling of rootpage that doesn't exist.
+  * attachment: Support adding attachments to pages even as they are being
+    created.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 25 Sep 2008 13:45:55 -0400