]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
remove, rename: Allow acting on attachments as a page is being created.
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 2 Oct 2008 16:53:53 +0000 (12:53 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 2 Oct 2008 16:53:53 +0000 (12:53 -0400)
IkiWiki/Plugin/remove.pm
IkiWiki/Plugin/rename.pm
debian/changelog

index c8d76368eb31813c0d5b3e40181b68afb1e94f28..cf95026c871570358a00d9bc1027c9dc291d66ad 100644 (file)
@@ -61,9 +61,10 @@ 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")) {
                # Removal button for the page, and also for attachments.
-               push @{$params{buttons}}, "Remove";
+               push @{$params{buttons}}, "Remove" if $form->field("do") eq "edit";
                $form->tmpl_param("field-remove" => '<input name="_submit" type="submit" value="Remove Attachments" />');
        }
 } #}}}
@@ -135,11 +136,12 @@ sub formbuilder (@) { #{{{
        my %params=@_;
        my $form=$params{form};
 
-       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")) {
                my $q=$params{cgi};
                my $session=$params{session};
 
-               if ($form->submitted eq "Remove") {
+               if ($form->submitted eq "Remove" && $form->field("do") eq "edit") {
                        removal_confirm($q, $session, 0, $form->field("page"));
                }
                elsif ($form->submitted eq "Remove Attachments") {
index 6c131487a3527c46c00b1ce57ca0a15936f04f49..7e55e271cbe6a403115fb38eff1f5655fbc626d6 100644 (file)
@@ -210,11 +210,12 @@ sub formbuilder (@) { #{{{
        my %params=@_;
        my $form=$params{form};
 
-       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")) {
                my $q=$params{cgi};
                my $session=$params{session};
 
-               if ($form->submitted eq "Rename") {
+               if ($form->submitted eq "Rename" && $form->field("do") eq "edit") {
                        rename_start($q, $session, 0, $form->field("page"));
                }
                elsif ($form->submitted eq "Rename Attachment") {
@@ -237,9 +238,10 @@ 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")) {
                # Rename button for the page, and also for attachments.
-               push @{$params{buttons}}, "Rename";
+               push @{$params{buttons}}, "Rename" if $form->field("do") eq "edit";
                $form->tmpl_param("field-rename" => '<input name="_submit" type="submit" value="Rename Attachment" />');
 
                if (defined $renamesummary) {
index b54fce7848115943758c1135dfbb9421f1477f08..0f3530cb21894620a18dd43350a745b8dfc9c85e 100644 (file)
@@ -35,6 +35,7 @@ ikiwiki (2.66) UNRELEASED; urgency=low
   * inline: Fix handling of rootpage that doesn't exist.
   * attachment: Support adding attachments to pages even as they are being
     created.
+  * remove, rename: Allow acting on attachments as a page is being created.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 25 Sep 2008 13:45:55 -0400