{** * Комментарии * * @param string $sTargetType * @param integer $iTargetId * @param array $aComments * @param boolean $bForbidAdd * @param string $sHeading * @param integer $iCountComment * @param boolean $bAllowSubscribe * * @styles css/comments.css *} {$sComponent = 'comments'} {block 'comment-list-options'} {$iTargetId = $smarty.local.iTargetId} {$sTargetType = $smarty.local.sTargetType} {$iCountComment = $smarty.local.iCountComment} {$bForbidAdd = $smarty.local.bForbidAdd} {if $bForbidAdd} {$mods = "$mods forbid"} {/if} {/block} {add_block group='toolbar' name='components/comment/toolbar.comment.tpl' target='.js-comment'}
{** * Заголовок *}

{lang name='comments.comments_declension' count=$iCountComment plural=true}

{** * Экшнбар *} {* Свернуть/развернуть все комментарии *} {$items = [ [ 'classes' => 'js-comments-fold-all-toggle', 'text' => $aLang.comments.folding.fold_all ] ]} {* Подписка на комментарии *} {if $bAllowSubscribe && $oUserCurrent} {* Подписан пользователь на комментарии или нет *} {$bIsSubscribed = $oSubscribeComment && $oSubscribeComment->getStatus()} {$items[] = [ 'classes' => "comments-subscribe js-comments-subscribe {if $bIsSubscribed}active{/if}", 'attributes' => "data-type=\"{$sTargetType}\" data-target-id=\"{$iTargetId}\"", 'text' => ( $bIsSubscribed ) ? $aLang.comments.unsubscribe : $aLang.comments.subscribe ]} {/if} {* TODO: Добавить хук *} {include 'components/actionbar/actionbar.tpl' items=$items classes='comments-actions'} {** * Комментарии *}
{include './comment-tree.tpl' aComments = $smarty.local.aComments bForbidAdd = $bForbidAdd bShowFavourite = $smarty.local.bShowFavourite bShowVote = $smarty.local.bShowVote}
{** * TODO: Пагинация *} {*include 'comments/comment_pagination.tpl' aPagingCmt=$aPagingCmt*} {** * Форма добавления комментария *} {* Проверяем запрещено комментирование или нет *} {if $bForbidAdd} {include 'components/alert/alert.tpl' mods='info' text=$sNoticeNotAllow} {* Если разрешено то показываем форму добавления комментария *} {else} {if $oUserCurrent} {* Кнопка открывающая форму *}

{$sNoticeCommentAdd|default:$aLang.comments.form.title}

{else} {include 'components/alert/alert.tpl' mods='info' text=$aLang.comments.alerts.unregistered} {/if} {/if} {* Форма добавления комментария *} {if $oUserCurrent && ( ! $bForbidAdd || ( $bForbidAdd && $iCountComment ) )} {include './comment-form.tpl' sTargetType=$sTargetType iTargetId=$iTargetId} {/if}