comments: Rename COMMENTURL to ADDCOMMENTURL to avoid confusion with COMMENTAUTHORURL

Also refactor page.tmpl to use if/else rather than unless/if.
master
Simon McVittie 2008-12-18 20:01:08 +00:00
parent 8ed94c0a18
commit 9e889c39ed
2 changed files with 6 additions and 7 deletions

View 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);
}
}

View File

@ -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>