1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-30 21:45:01 +03:00

Fixes #446 Ссылка на комментарии не показывается если комментирование запрещено и кол-во комментариев равно нулю

This commit is contained in:
Denis Shakhov 2014-05-10 23:29:18 +07:00
parent 44c342773c
commit f4f27d2590
3 changed files with 24 additions and 21 deletions

View file

@ -13,7 +13,7 @@
sTargetType = 'topic'
iCountComment = $oTopic->getCountComment()
sDateReadLast = $oTopic->getDateRead()
bAllowNewComment = $oTopic->getForbidComment()
bForbidNewComment = $oTopic->getForbidComment()
sNoticeNotAllow = $aLang.topic_comment_notallow
sNoticeCommentAdd = $aLang.topic_comment_add
bAllowSubscribe = true

View file

@ -22,26 +22,28 @@
{**
* Хидер
*}
<header class="comments-header">
<h3 class="comments-title js-comments-title">{$iCountComment} {$iCountComment|declension:$aLang.comments.comments_declension}</h3>
{if ! $bForbidNewComment || ( $bForbidNewComment && $iCountComment )}
<header class="comments-header">
<h3 class="comments-title js-comments-title">{$iCountComment} {$iCountComment|declension:$aLang.comments.comments_declension}</h3>
{* Подписка на комментарии *}
{if $bAllowSubscribe and $oUserCurrent}
<p><label class="comments-subscribe">
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);"
{if $oSubscribeComment and $oSubscribeComment->getStatus()}checked{/if}>
{$aLang.comments.subscribe}
</label></p><br>
{/if}
{* Подписка на комментарии *}
{if $bAllowSubscribe and $oUserCurrent}
<p><label class="comments-subscribe">
<input
type="checkbox"
id="comment_subscribe"
class="input-checkbox"
onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);"
{if $oSubscribeComment and $oSubscribeComment->getStatus()}checked{/if}>
{$aLang.comments.subscribe}
</label></p><br>
{/if}
{* Свернуть/развернуть все *}
<a href="#" class="link-dotted js-comments-fold-all">{$aLang.comments.folding.fold_all}</a> |
<a href="#" class="link-dotted js-comments-unfold-all">{$aLang.comments.folding.unfold_all}</a>
</header>
{* Свернуть/развернуть все *}
<a href="#" class="link-dotted js-comments-fold-all">{$aLang.comments.folding.fold_all}</a> |
<a href="#" class="link-dotted js-comments-unfold-all">{$aLang.comments.folding.unfold_all}</a>
</header>
{/if}
{**
* Комментарии
@ -86,7 +88,7 @@
{**
* Форма добавления комментария
*}
{if $bAllowNewComment}
{if $bForbidNewComment}
{include 'components/alert/alert.tpl' sMods='info' mAlerts=$sNoticeNotAllow}
{else}
{if $oUserCurrent}

View file

@ -102,7 +102,8 @@
{/if}
{* Ссылка на комментарии *}
{if $bTopicList}
{* Не показываем если комментирование запрещено и кол-во комментариев равно нулю *}
{if $bTopicList && ( ! $oTopic->getForbidComment() || ( $oTopic->getForbidComment() && $oEntry->getCountComment() ) )}
<li class="topic-info-item topic-info-item-comments">
<a href="{$oEntry->getUrl()}#comments" title="{$aLang.topic_comment_read}">{$oEntry->getCountComment()} {$oEntry->getCountComment()|declension:$aLang.comments.comments_declension}</a>
{if $oEntry->getCountCommentNew()}<span>+{$oEntry->getCountCommentNew()}</span>{/if}