From 527d178c12141d2467dfa86492e249d021b88997 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 14:56:10 -0400 Subject: [PATCH] comments: Add link to comment post form to allow user to sign in if they wish to, if the configuration makes signin optional for commenting. --- IkiWiki/Plugin/comments.pm | 7 +++++++ debian/changelog | 3 +++ po/ikiwiki.pot | 26 +++++++++++++------------- templates/editcomment.tmpl | 5 ++++- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 98f9f8b3d..e618d1a90 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -317,6 +317,13 @@ sub editcomment ($$) { force => 1); } + if (! defined $session->param('name')) { + # Make signinurl work and return here. + $form->tmpl_param(signinurl => IkiWiki::cgiurl(do => 'signin')); + $session->param(postsignin => $ENV{QUERY_STRING}); + IkiWiki::cgi_savesession($session); + } + # The untaint is OK (as in editpage) because we're about to pass # it to file_pruned anyway my $page = $form->field('page'); diff --git a/debian/changelog b/debian/changelog index f8378f098..de4ac4a8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ ikiwiki (3.11) UNRELEASED; urgency=low error. * inline: Display a handy error message if the inline cannot display any pages due to such an error. + * comments: Add link to comment post form to allow user to sign in + if they wish to, if the configuration makes signin optional + for commenting. -- Joey Hess Tue, 21 Apr 2009 21:41:38 -0400 diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 6c9b16289..254bf83be 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-23 14:02-0400\n" +"POT-Creation-Date: 2009-04-23 14:43-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -212,55 +212,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:326 ../IkiWiki/Plugin/editpage.pm:97 +#: ../IkiWiki/Plugin/comments.pm:331 ../IkiWiki/Plugin/editpage.pm:97 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:331 +#: ../IkiWiki/Plugin/comments.pm:336 #, perl-format msgid "commenting on %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:349 +#: ../IkiWiki/Plugin/comments.pm:354 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:356 +#: ../IkiWiki/Plugin/comments.pm:361 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:450 +#: ../IkiWiki/Plugin/comments.pm:455 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:452 +#: ../IkiWiki/Plugin/comments.pm:457 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:465 +#: ../IkiWiki/Plugin/comments.pm:470 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:474 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:511 ../IkiWiki/Plugin/websetup.pm:236 +#: ../IkiWiki/Plugin/comments.pm:516 ../IkiWiki/Plugin/websetup.pm:236 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:562 +#: ../IkiWiki/Plugin/comments.pm:567 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:601 +#: ../IkiWiki/Plugin/comments.pm:606 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:752 +#: ../IkiWiki/Plugin/comments.pm:757 msgid "Comments" msgstr "" diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl index 7590cdfd7..27d9457d4 100644 --- a/templates/editcomment.tmpl +++ b/templates/editcomment.tmpl @@ -6,8 +6,11 @@ -Name: (optional)
+Name: (optional, or +Signin)
Website: (optional)
+ +(You might want to Signin first?)
Subject:
-- 2.26.2