{** * Комментарии * * @param array $comments * @param integer $count * @param integer $targetId * @param string $targetType * @param string $dateReadLast * @param boolean $forbidAdd * @param integer $authorId * @param integer $lastCommentId * @param array $pagination * @param boolean $isSubscribed * * @param boolean $useVote * @param boolean $useFavourite * @param boolean $useSubscribe * * @param string $forbidText * @param string $authorText * @param string $addCommentText * @param string $titleLang * * @param string $classes * @param array $attributes * @param string $mods *} {$component = 'comments'} {block 'comment-list-options'} {$mods = $smarty.local.mods} {$targetId = $smarty.local.targetId} {$targetType = $smarty.local.targetType} {$count = $smarty.local.count} {$forbidAdd = $smarty.local.forbidAdd} {$isSubscribed = $smarty.local.isSubscribed} {if $forbidAdd} {$mods = "$mods forbid"} {/if} {/block} {add_block group='toolbar' name='components/comment/toolbar.comment.tpl' target='.js-comment'}
{** * Заголовок *}

{lang "{$smarty.local.titleLang|default:'comments.comments_declension'}" count=$count plural=true}

{** * Экшнбар *} {* Свернуть/развернуть все комментарии *} {$items = [ [ 'classes' => 'js-comments-fold-all-toggle', 'text' => $aLang.comments.folding.fold_all ] ]} {* Подписка на комментарии *} {if $smarty.local.useSubscribe && $oUserCurrent} {$items[] = [ 'classes' => "comments-subscribe js-comments-subscribe {if $isSubscribed}active{/if}", 'attributes' => "data-type=\"{$targetType}\" data-target-id=\"{$targetId}\"", 'text' => ( $isSubscribed ) ? $aLang.comments.unsubscribe : $aLang.comments.subscribe ]} {/if} {* TODO: Добавить хук *} {include 'components/actionbar/actionbar.tpl' items=$items classes='comments-actions'} {** * Комментарии *}
{include './comment-tree.tpl' comments = $smarty.local.comments forbidAdd = $forbidAdd authorText = $smarty.local.authorText dateReadLast = $smarty.local.dateReadLast useFavourite = $smarty.local.useFavourite useVote = $smarty.local.useVote}
{** * TODO: Пагинация *} {*include 'components/pagination/pagination.tpl' pagination=$smarty.local.pagination*} {** * Форма добавления комментария *} {* Проверяем запрещено комментирование или нет *} {if $forbidAdd} {include 'components/alert/alert.tpl' mods='info' text=$smarty.local.forbidText} {* Если разрешено то показываем форму добавления комментария *} {else} {if $oUserCurrent} {* Кнопка открывающая форму *}

{$smarty.local.addCommentText|default:$aLang.comments.form.title}

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