2013-05-23 20:15:54 +03:00
{ * *
* Комментарий
*
2013-08-29 12:30:04 +03:00
* @param boolean bAllowNewComment true если разрешно добавлять новые комментарии
* @param boolean bOneComment
* @param boolean bNoCommentFavourites true если не нужно выводить кнопку добавления в избранное
* @param integer iAuthorId ID автора топика
* @param boolean bList true если комментарий выводится в списках (например на странице Избранные комментарии)
2013-05-23 20:15:54 +03:00
*
* @styles css/comments.css
*}
2011-04-01 10:49:36 +03:00
2013-05-23 20:15:54 +03:00
{ $oUser = $oComment - > getUser ( ) }
2012-03-07 18:48:14 +02:00
2013-05-23 20:15:54 +03:00
{ * Выводим ссылки на блог и топик в котором находится комментарий (только в списках) * }
{ if $bList }
{ $oTopic = $oComment - > getTarget ( ) }
{ $oBlog = $oTopic - > getBlog ( ) }
<div class="comment-path">
2014-01-25 14:47:28 +02:00
<a href=" { $oBlog - > getUrlFull ( ) } " class="comment-path-blog"> { $oBlog - > getTitle ( ) | escape } </a> →
<a href=" { $oTopic - > getUrl ( ) } "> { $oTopic - > getTitle ( ) | escape } </a>
2013-05-23 20:15:54 +03:00
<a href=" { $oTopic - > getUrl ( ) } #comments">( { $oTopic - > getCountComment ( ) } )</a>
</div>
{ /if }
{ * Комментарий * }
2014-02-17 10:26:20 +02:00
<section data-id=" { $oComment - > getId ( ) } " id="comment { $oComment - > getId ( ) } " class="js-comment comment open
2013-05-23 20:15:54 +03:00
{ if ! $bList }
{ if $oComment - > isBad ( ) }
comment-bad
{ /if }
2012-03-07 18:48:14 +02:00
2013-05-23 20:15:54 +03:00
{ if $oComment - > getDelete ( ) }
comment-deleted
2014-02-17 10:26:20 +02:00
{ elseif $oUserCurrent and $oComment - > getUserId ( ) = = $oUserCurrent - > getId ( ) }
2013-05-23 20:15:54 +03:00
comment-self
2014-02-17 10:26:20 +02:00
{ elseif $sDateReadLast < = $oComment - > getDate ( ) }
2013-05-23 20:15:54 +03:00
comment-new
{ /if }
{ else }
comment-list-item
2012-03-07 18:48:14 +02:00
{ /if } ">
2013-09-27 05:39:28 +03:00
{ if ! $oComment - > getDelete ( ) or ( $oUserCurrent and $oUserCurrent - > isAdministrator ( ) ) }
2013-05-23 20:15:54 +03:00
{ * Аватар пользователя * }
<a href=" { $oUser - > getUserWebPath ( ) } ">
2013-10-23 10:02:40 +03:00
<img src=" { $oUser - > getProfileAvatarPath ( 4 8 ) } " alt=" { $oUser - > getDisplayName ( ) } " class="comment-avatar" />
2013-05-23 20:15:54 +03:00
</a>
2014-02-17 10:26:20 +02:00
2013-05-23 20:15:54 +03:00
{ * Информация * }
2012-04-15 01:55:47 +03:00
<ul class="comment-info">
2013-05-23 20:15:54 +03:00
{ * Автор комментария * }
2013-08-29 12:30:04 +03:00
<li class="comment-username { if $iAuthorId = = $oUser - > getId ( ) } comment-username-author { /if } " title=" { if $sAuthorNotice } { $sAuthorNotice } { /if } ">
2013-10-23 10:02:40 +03:00
<a href=" { $oUser - > getUserWebPath ( ) } "> { $oUser - > getDisplayName ( ) } </a>
2012-04-15 01:55:47 +03:00
</li>
2014-02-17 10:26:20 +02:00
2013-05-23 20:15:54 +03:00
{ * Дата * }
2012-03-07 18:48:14 +02:00
<li class="comment-date">
2014-02-17 10:26:20 +02:00
<a href=" { if $oConfig - > GetValue ( 'module.comment.use_nested' ) } { router page = 'comments' } { else } #comment { /if } { $oComment - > getId ( ) } " class="link-dotted" title=" { $aLang.comments.comment.url } ">
2012-03-18 02:45:20 +02:00
<time datetime=" { date_format date = $oComment - > getDate ( ) format = 'c' } "> { date_format date = $oComment - > getDate ( ) hours_back = "12" minutes_back = "60" now = "60" day = "day H:i" format = "j F Y, H:i" } </time>
2012-03-07 18:48:14 +02:00
</a>
2011-04-01 10:49:36 +03:00
</li>
2014-02-17 10:26:20 +02:00
{ * Прокрутка к родительскии/дочернии комментариям * }
2013-05-23 20:15:54 +03:00
{ if ! $bList and $oComment - > getPid ( ) }
2014-02-17 10:26:20 +02:00
<li class="comment-scroll-to comment-scroll-to-parent js-comment-scroll-to-parent" title=" { $aLang.comments.comment.scroll_to_parent } " data-id=" { $oComment - > getId ( ) } " data-parent-id=" { $oComment - > getPid ( ) } ">↑</li>
2012-03-07 18:48:14 +02:00
{ /if }
2013-05-23 20:15:54 +03:00
2014-02-17 10:26:20 +02:00
<li class="comment-scroll-to comment-scroll-to-child js-comment-scroll-to-child" title=" { $aLang.comments.comment.scroll_to_child } ">↓</li>
{ * Голосование * }
{ if $oComment - > getTargetType ( ) ! = 'talk' }
2014-01-31 08:53:19 +02:00
<li> { include 'vote.tpl' sVoteType = 'comment' oVoteObject = $oComment bVoteIsLocked = ( $oUserCurrent & & $oUserCurrent - > getId ( ) = = $oUser - > getId ( ) ) } </li>
2012-03-07 18:48:14 +02:00
{ /if }
2014-02-17 10:26:20 +02:00
2013-08-29 12:30:04 +03:00
{ * Избранное * }
2013-05-23 20:15:54 +03:00
{ if $oUserCurrent and ! $bNoCommentFavourites }
2014-01-28 13:44:57 +02:00
<li> { include 'favourite.tpl' sFavouriteType = 'comment' oFavouriteObject = $oComment } </li>
2012-03-07 18:48:14 +02:00
{ /if }
</ul>
2014-02-17 10:26:20 +02:00
2013-05-23 20:15:54 +03:00
{ * Текст комментария * }
2012-03-07 18:48:14 +02:00
<div id="comment_content_id_ { $oComment - > getId ( ) } " class="comment-content text">
{ $oComment - > getText ( ) }
2011-04-01 10:49:36 +03:00
</div>
2013-05-23 20:15:54 +03:00
{ * Кнопки ответа, удаления и т.д. * }
2012-03-07 18:48:14 +02:00
{ if $oUserCurrent }
<ul class="comment-actions">
2013-05-23 20:15:54 +03:00
{ if ! $bList and ! $oComment - > getDelete ( ) and ! $bAllowNewComment }
2014-02-17 10:26:20 +02:00
<li><a href="#" class="link-dotted js-comment-reply" data-id=" { $oComment - > getId ( ) } "> { $aLang.comments.comment.reply } </a></li>
2012-03-07 18:48:14 +02:00
{ /if }
2014-02-17 10:26:20 +02:00
<li class="link-dotted comment-fold js-comment-fold open" data-id=" { $oComment - > getId ( ) } " style="display: none"><a href="#"> { $aLang.comments.folding.fold } </a></li>
{ if $oUserCurrent and $oUserCurrent - > isAdministrator ( ) }
<li><a href="#" class="link-dotted js-comment-remove" data-id=" { $oComment - > getId ( ) } "> { ( $oComment - > getDelete ( ) ) ? $aLang.comments.comment.restore : $aLang.common.remove } </a></li>
2012-03-07 18:48:14 +02:00
{ /if }
2014-02-17 10:26:20 +02:00
2012-03-07 18:48:14 +02:00
{ hook run = 'comment_action' comment = $oComment }
</ul>
{ /if }
2014-02-17 10:26:20 +02:00
{ else }
{ $aLang.comments.comment.deleted }
{ /if }
2012-03-07 18:48:14 +02:00
</section>