{** * comments.tpl * * Copyright (c) 2003-2011 John Willinsky * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. * * Display comments on an article. * * $Id$ *} {strip} {if $comment} {assign var=pageTitle value="comments.readerComments"} {assign var=pageCrumbTitleTranslated value=$comment->getTitle()|escape|truncate:50:"..."|default:" "} {else} {assign var=pageTitle value="comments.readerComments"} {/if} {include file="common/header.tpl"} {/strip} {if $enableComments==COMMENTS_UNAUTHENTICATED || (($enableComments==COMMENTS_AUTHENTICATED || $enableComments==COMMENTS_ANONYMOUS) && $isUserLoggedIn)} {assign var=postingAllowed value=1} {else} {assign var=postingAllowed value=0} {/if}
{if $comment} {assign var=user value=$comment->getUser()}

{$comment->getTitle()|escape|default:" "}

{if $user} {translate key="comments.authenticated" userName=$user->getFullName()|escape} {elseif $comment->getPosterName()} {translate key="comments.anonymousNamed" userName=$comment->getPosterName()|escape} {else} {translate key="comments.anonymous"} {/if} ({$comment->getDatePosted()|date_format:$dateFormatShort})

{if $parent} {assign var=parentId value=$parent->getCommentId()} {url|assign:"url" page="comment" op="view" path=$articleId|to_array:$parentId} {translate key="comments.inResponseTo" url=$url title=$parent->getTitle()|escape|default:" "}
{/if} {assign var="hasPriorAction" value=0}{* Track whether to add "|" between actions *} {if $comment->getPosterEmail()} {translate|assign:"emailReply" key="comments.emailReply"} {mailto text=$emailReply encode="javascript" address=$comment->getPosterEmail() subject=$comment->getTitle()|default:" " extra='class="action"'} {assign var="hasPriorAction" value=1} {/if} {if $postingAllowed} {if $hasPriorAction} | {/if} getId()}" class="action">{translate key="comments.postReply"} {assign var="hasPriorAction" value=1} {/if} {if $isManager} {if $hasPriorAction} | {/if} getId()}" {if $comment->getChildCommentCount()!=0}onclick="return confirm('{translate|escape:"jsparam" key="comments.confirmDeleteChildren"}')" {/if}class="action">{translate key="comments.delete"} {assign var="hasPriorAction" value=1} {/if}

{$comment->getBody()|strip_unsafe_html|nl2br}

{if $comments}

{translate key="comments.replies"}

{/if} {/if} {foreach from=$comments item=child} {assign var=user value=$child->getUser()} {assign var=childId value=$child->getCommentId()}

{$child->getTitle()|escape|default:" "}

{if $user} {translate key="comments.authenticated" userName=$user->getFullName()|escape} {elseif $child->getPosterName()} {translate key="comments.anonymousNamed" userName=$child->getPosterName()|escape} {else} {translate key="comments.anonymous"} {/if} ({$child->getDatePosted()|date_format:$dateFormatShort})
{assign var="hasPriorAction" value=0} {if $child->getPosterEmail()} {translate|assign:"emailReply" key="comments.emailReply"} {mailto text=$emailReply encode="javascript" address=$child->getPosterEmail()|escape subject=$child->getTitle()|escape|default:" " extra='class="action"'} {assign var="hasPriorAction" value=1} {/if} {if $postingAllowed} {if $hasPriorAction} | {/if} {translate key="comments.postReply"} {assign var="hasPriorAction" value=1} {/if} {if $isManager} {if $hasPriorAction} | {/if} getCommentId()}" {if $child->getChildCommentCount()!=0}onclick="return confirm('{translate|escape:"jsparam" key="comments.confirmDeleteChildren"}')" {/if}class="action">{translate key="comments.delete"} {assign var="hasPriorAction" value=1} {/if}
{translate|assign:"readMore" key="comments.readMore"} {url|assign:"moreUrl" op="view" path=$articleId|to_array:$galleyId:$childId} {assign var=moreLink value="$readMore"}

{$child->getBody()|strip_unsafe_html|nl2br|truncate:300:"... $moreLink"}

{assign var=grandChildren value=$child->getChildren()} {if $grandChildren} {/if} {foreachelse} {if !$comment} {translate key="comments.noComments"} {/if} {/foreach} {if $postingAllowed}

{translate key="rt.addComment"}

{/if}
{include file="common/footer.tpl"}