]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 21 Sep 2008 00:06:54 +0000 (20:06 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 21 Sep 2008 00:06:54 +0000 (20:06 -0400)
IkiWiki/Plugin/edittemplate.pm
IkiWiki/Plugin/progress.pm
debian/changelog
doc/todo/Allow_edittemplate_to_set_file_type.mdwn

index 98308de135ba42c6efc5d574b261d51cc5f18e29..4d4117c150a8c958b70af9ec17dc98671474c11b 100644 (file)
@@ -56,8 +56,14 @@ sub preprocess (@) { #{{{
 
        $pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
 
+       return "" if ($params{silent} && IkiWiki::yesno($params{silent}));
+
+       my $link=IkiWiki::linkpage($params{template});
+       add_depends($params{page}, $link);
+       my $linkHTML = htmllink($params{page}, $params{destpage}, $link);
+
        return sprintf(gettext("edittemplate %s registered for %s"),
-               $params{template}, $params{match});
+               $linkHTML, $params{match});
 } # }}}
 
 sub formbuilder (@) { #{{{
@@ -87,8 +93,12 @@ sub formbuilder (@) { #{{{
                        if (exists $pagestate{$registering_page}{edittemplate}) {
                                foreach my $pagespec (sort keys %{$pagestate{$registering_page}{edittemplate}}) {
                                        if (pagespec_match($p, $pagespec, location => $registering_page)) {
+                                               my $template=$pagestate{$registering_page}{edittemplate}{$pagespec};
                                                $form->field(name => "editcontent",
-                                                        value => filltemplate($pagestate{$registering_page}{edittemplate}{$pagespec}, $page));
+                                                        value =>  filltemplate($template, $page));
+                                               $form->field(name => "type",
+                                                        value => pagetype($pagesources{$template}))
+                                                               if $pagesources{$template};
                                                return;
                                        }
                                }
index 2c015284e6fd4188f704c1bfceaaf7247c271443..e536f4e23370773aebd296e290d0c84b2ded83ae 100644 (file)
@@ -29,12 +29,11 @@ sub preprocess (@) { #{{{
        if (defined $params{percent}) {
                $fill = $params{percent};
                ($fill) = $fill =~ m/($percentage_pattern)/; # fill is untainted now
+               $fill=~s/%$//;
                if (! defined $fill || ! length $fill || $fill > 100 || $fill < 0) {
                        error(sprintf(gettext("illegal percent value %s"), $params{percent}));
                }
-               elsif ($fill !~ /%$/) {
-                       $fill.="%";
-               }
+               $fill.="%";
        }
        elsif (defined $params{totalpages} and defined $params{donepages}) {
                add_depends($params{page}, $params{totalpages});
index a44b890581351381988a3e4dd9c68939d854349f..6019e396026a9d23fe8c1c8b3ec73354e36b436a 100644 (file)
@@ -10,6 +10,10 @@ ikiwiki (2.65) UNRELEASED; urgency=low
   * Fix reversion in use of ikiwiki -verbose -setup with a setup file that
     enables syslog. Setup output is once again output to stdout in this
     case.
+  * edittemplate: Default new page file type to the same type as the template.
+    (willu)
+  * edittemplate: Add "silent" parameter. (Willu)
+  * edittemplate: Link to template, to allow creating it. (Willu)
 
  -- Joey Hess <joeyh@debian.org>  Wed, 17 Sep 2008 14:26:56 -0400
 
index 9981c530baa3a158a0afcbd0c4dfdc4467715537..b49968c18f2e4185af45f95b9a9f802181d2110d 100644 (file)
@@ -5,6 +5,9 @@ Below is a [[patch]] to [[plugins/edittemplate]] that does a few things:
  * It makes the description of what was registered link to the template page (which gives feedback for typos or allows template creation)
  * It adds a colon to the standard string correcting the syntax.
 
+[[done]] except for the colon change; it's referring to the template as an
+edittemplate there. --[[Joey]]
+
 ----
 
     diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm
@@ -38,3 +41,4 @@ Below is a [[patch]] to [[plugins/edittemplate]] that does a few things:
                                                return;
                                        }
                                }
+