diff options
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 4 | ||||
-rw-r--r-- | templates/page.tmpl | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index d095a00bd..4f3b76db3 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -548,9 +548,9 @@ sub pagetemplate (@) { } if ($shown && commentsopen($page)) { - my $commenturl = IkiWiki::cgiurl(do => 'comment', + my $addcommenturl = IkiWiki::cgiurl(do => 'comment', page => $page); - $template->param(commenturl => $commenturl); + $template->param(addcommenturl => $addcommenturl); } } diff --git a/templates/page.tmpl b/templates/page.tmpl index 21abc979d..f75491127 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -74,13 +74,12 @@ <TMPL_IF COMMENTS> <div id="comments"> <TMPL_VAR COMMENTS> -<TMPL_UNLESS COMMENTURL> -<div class="addcomment">Comments on this page are closed.</div> -</TMPL_UNLESS> -<TMPL_IF COMMENTURL> +<TMPL_IF ADDCOMMENTURL> <div class="addcomment"> -<a href="<TMPL_VAR COMMENTURL>">Add a comment</a> +<a href="<TMPL_VAR ADDCOMMENTURL>">Add a comment</a> </div> +<TMPL_ELSE> +<div class="addcomment">Comments on this page are closed.</div> </TMPL_IF> </div> </TMPL_IF> |