From: Joey Hess Date: Thu, 2 Oct 2008 16:48:06 +0000 (-0400) Subject: attachment: Support adding attachments to pages even as they are being created. X-Git-Tag: 2.66~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c9459523813052ee187bdad1c8594ae114bece62;p=ikiwiki.git attachment: Support adding attachments to pages even as they are being created. --- diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 837992841..2d1fe51cf 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -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 && diff --git a/debian/changelog b/debian/changelog index 6c6eea205..b54fce784 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 25 Sep 2008 13:45:55 -0400