]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
comments: Rename COMMENTURL to ADDCOMMENTURL to avoid confusion with COMMENTAUTHORURL
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 18 Dec 2008 20:01:08 +0000 (20:01 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sat, 20 Dec 2008 17:34:55 +0000 (17:34 +0000)
Also refactor page.tmpl to use if/else rather than unless/if.

IkiWiki/Plugin/comments.pm
templates/page.tmpl

index d095a00bda2eb217186af5ae8bf56411c62b2339..4f3b76db3dcb09850c607436632b1887af4f19c6 100644 (file)
@@ -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);
                }
        }
 
index 21abc979dc71f66d9ac3aa886a2e2b44e14429b7..f75491127bfd33a921c97bbc1177f48d11874282 100644 (file)
 <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>