X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9c5f4761d8bf785ca98d5fda66fbbe9dbe11897c..c43fc8607e78bc4f36eec726beae35db67b383fb:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index c785e31de..c2dacf78d 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -33,10 +33,9 @@ sub showform ($$$$) { #{{{ buttons => $buttons); }); } - else { - printheader($session); - print misctemplate($form->title, $form->render(submit => $buttons)); - } + + printheader($session); + print misctemplate($form->title, $form->render(submit => $buttons)); } sub redirect ($$) { #{{{ @@ -249,7 +248,7 @@ sub cgi_prefs ($$) { #{{{ $form->field(name => "email", size => 50, fieldset => "preferences"); $form->field(name => "subscriptions", size => 50, fieldset => "preferences", - comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")"); + comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")"); $form->field(name => "banned_users", size => 50, fieldset => "admin"); @@ -311,9 +310,6 @@ sub cgi_editpage ($$) { #{{{ fields => \@fields, charset => "utf-8", method => 'POST', - validate => { - editcontent => '/.+/', - }, required => [qw{editcontent}], javascript => 0, params => $q, @@ -357,6 +353,7 @@ sub cgi_editpage ($$) { #{{{ $form->field(name => "rcsinfo", value => rcs_prepedit($file), force => 1); } + $form->field(name => "editcontent", validate => '/.*/'); } else { $type=$form->param('type'); @@ -372,6 +369,7 @@ sub cgi_editpage ($$) { #{{{ if (! $form->submitted) { $form->field(name => "rcsinfo", value => "", force => 1); } + $form->field(name => "editcontent", validate => '/.+/'); } $form->field(name => "do", type => 'hidden'); @@ -386,7 +384,9 @@ sub cgi_editpage ($$) { #{{{ $form->tmpl_param("can_commit", $config{rcs}); $form->tmpl_param("indexlink", indexlink()); $form->tmpl_param("helponformattinglink", - htmllink("", "", "HelpOnFormatting", noimageinline => 1)); + htmllink("", "", "ikiwiki/formatting", + noimageinline => 1, + linktext => "FormattingHelp")); $form->tmpl_param("baseurl", baseurl()); if ($form->submitted eq "Cancel") { @@ -506,6 +506,7 @@ sub cgi_editpage ($$) { #{{{ } showform($form, \@buttons, $session, $q); + saveindex(); } else { # save page @@ -550,6 +551,7 @@ sub cgi_editpage ($$) { #{{{ }); $content=~s/\r\n/\n/g; $content=~s/\r/\n/g; + $content.="\n" if $content !~ /\n$/; $config{cgi}=0; # avoid cgi error message eval { writefile($file, $config{srcdir}, $content) }; @@ -595,6 +597,10 @@ sub cgi_editpage ($$) { #{{{ # may have been committed while the post-commit hook was # disabled. require IkiWiki::Render; + # Reload index, since the first time it's loaded is before + # the wiki is locked, and things may have changed in the + # meantime. + loadindex(); refresh(); saveindex();