diff options
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/edittemplate.pm | 14 | ||||
-rw-r--r-- | IkiWiki/Plugin/progress.pm | 5 |
2 files changed, 14 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 98308de13..4d4117c15 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -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; } } diff --git a/IkiWiki/Plugin/progress.pm b/IkiWiki/Plugin/progress.pm index 2c015284e..e536f4e23 100644 --- a/IkiWiki/Plugin/progress.pm +++ b/IkiWiki/Plugin/progress.pm @@ -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}); |