2013-05-23 20:15:54 +03:00
{ * *
* Комментарий
*
* bAllowNewComment true если разрешно добавлять новые комментарии
* bOneComment
* bNoCommentFavourites true если не нужно выводить кнопку добавления в избранное
* iAuthorId ID автора топика
* bList true если комментарий выводится в списках (например на странице Избранные комментарии)
*
* @styles css/comments.css
*}
2011-04-01 10:49:36 +03:00
2013-05-23 20:15:54 +03:00
{ $oUser = $oComment - > getUser ( ) }
{ $oVote = $oComment - > getVote ( ) }
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">
<a href=" { $oBlog - > getUrlFull ( ) } " class="comment-path-blog"> { $oBlog - > getTitle ( ) | escape : 'html' } </a> →
<a href=" { $oTopic - > getUrl ( ) } "> { $oTopic - > getTitle ( ) | escape : 'html' } </a>
<a href=" { $oTopic - > getUrl ( ) } #comments">( { $oTopic - > getCountComment ( ) } )</a>
</div>
{ /if }
{ * Комментарий * }
2012-03-07 18:48:14 +02:00
<section id="comment_id_ { $oComment - > getId ( ) } " class="comment
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
{ elseif $oUserCurrent and $oComment - > getUserId ( ) = = $oUserCurrent - > getId ( ) }
comment-self
{ elseif $sDateReadLast < = $oComment - > getDate ( ) }
comment-new
{ /if }
{ else }
comment-list-item
2012-03-07 18:48:14 +02:00
{ /if } ">
2013-05-23 20:15:54 +03:00
{ if ! $oComment - > getDelete ( ) or $bOneComment or ( $oUserCurrent and $oUserCurrent - > isAdministrator ( ) ) }
2012-03-07 18:48:14 +02:00
<a name="comment { $oComment - > getId ( ) } "></a>
2013-05-23 20:15:54 +03:00
{ * Аватар пользователя * }
<a href=" { $oUser - > getUserWebPath ( ) } ">
<img src=" { $oUser - > getProfileAvatarPath ( 4 8 ) } " alt=" { $oUser - > getLogin ( ) } " class="comment-avatar" />
</a>
2012-03-07 18:48:14 +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
{ * Автор комментария * }
2012-04-15 01:55:47 +03:00
<li class="comment-author">
2013-05-23 20:15:54 +03:00
{ if $iAuthorId = = $oUser - > getId ( ) }
<span class="comment-topic-author" title=" { if $sAuthorNotice } { $sAuthorNotice } { /if } "> { $aLang.comment_target_author } </span>
{ /if }
2012-04-15 01:55:47 +03:00
<a href=" { $oUser - > getUserWebPath ( ) } "> { $oUser - > getLogin ( ) } </a>
</li>
2013-05-23 20:15:54 +03:00
{ * Дата * }
2012-03-07 18:48:14 +02:00
<li class="comment-date">
2012-04-19 21:04:25 +03:00
<a href=" { if $oConfig - > GetValue ( 'module.comment.nested_per_page' ) } { router page = 'comments' } { else } #comment { /if } { $oComment - > getId ( ) } " class="link-dotted" title=" { $aLang.comment_url_notice } ">
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>
2012-03-07 18:48:14 +02:00
2013-05-23 20:15:54 +03:00
{ * Ссылки на родительские/дочерние комментарии * }
{ if ! $bList and $oComment - > getPid ( ) }
<li class="comment-goto comment-goto-parent">
<a href="#" onclick="ls.comments.goToParentComment( { $oComment - > getId ( ) } , { $oComment - > getPid ( ) } ); return false;" title=" { $aLang.comment_goto_parent } ">↑</a>
</li>
2012-03-07 18:48:14 +02:00
{ /if }
2013-05-23 20:15:54 +03:00
<li class="comment-goto comment-goto-child"><a href="#" title=" { $aLang.comment_goto_child } ">↓</a></li>
2012-03-07 18:48:14 +02:00
2013-05-23 20:15:54 +03:00
{ * *
* Блок голосования
* Н е выводим блок голосования в личных сообщениях и списках
*}
2012-03-07 18:48:14 +02:00
{ if $oComment - > getTargetType ( ) ! = 'talk' }
<li id="vote_area_comment_ { $oComment - > getId ( ) } " class="vote
{ if $oComment - > getRating ( ) > 0 }
vote-count-positive
{ elseif $oComment - > getRating ( ) < 0 }
vote-count-negative
{ /if }
{ if $oVote }
voted
{ if $oVote - > getDirection ( ) > 0 }
voted-up
{ else }
voted-down
{ /if }
{ /if } ">
<div class="vote-down" onclick="return ls.vote.vote( { $oComment - > getId ( ) } ,this,-1,'comment');"></div>
2012-07-14 18:56:02 +03:00
<span class="vote-count" id="vote_total_comment_ { $oComment - > getId ( ) } "> { if $oComment - > getRating ( ) > 0 } + { /if } { $oComment - > getRating ( ) } </span>
2012-03-07 18:48:14 +02:00
<div class="vote-up" onclick="return ls.vote.vote( { $oComment - > getId ( ) } ,this,1,'comment');"></div>
</li>
{ /if }
2013-05-23 20:15:54 +03:00
{ * Кнопка добавления в избранное * }
{ if $oUserCurrent and ! $bNoCommentFavourites }
2012-03-07 18:48:14 +02:00
<li class="comment-favourite">
2013-07-03 08:30:44 +03:00
<div onclick="return ls.favourite.toggle( { $oComment - > getId ( ) } ,this,'comment');"
class="favourite { if $oComment - > getIsFavourite ( ) } active { /if } "
title=" { if $oComment - > getIsFavourite ( ) } { $aLang.talk_favourite_del } { else } { $aLang.talk_favourite_add } { /if } "></div>
2012-03-07 18:48:14 +02:00
<span class="favourite-count" id="fav_count_comment_ { $oComment - > getId ( ) } "> { if $oComment - > getCountFavourite ( ) > 0 } { $oComment - > getCountFavourite ( ) } { /if } </span>
</li>
{ /if }
</ul>
2011-04-01 10:49:36 +03: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 }
2012-03-07 18:48:14 +02:00
<li><a href="#" onclick="ls.comments.toggleCommentForm( { $oComment - > getId ( ) } ); return false;" class="reply-link link-dotted"> { $aLang.comment_answer } </a></li>
{ /if }
2013-05-23 20:15:54 +03:00
{ if ! $oComment - > getDelete ( ) and $oUserCurrent and $oUserCurrent - > isAdministrator ( ) }
2012-03-07 18:48:14 +02:00
<li><a href="#" class="comment-delete link-dotted" onclick="ls.comments.toggle(this, { $oComment - > getId ( ) } ); return false;"> { $aLang.comment_delete } </a></li>
{ /if }
{ if $oComment - > getDelete ( ) and $oUserCurrent and $oUserCurrent - > isAdministrator ( ) }
<li><a href="#" class="comment-repair link-dotted" onclick="ls.comments.toggle(this, { $oComment - > getId ( ) } ); return false;"> { $aLang.comment_repair } </a></li>
{ /if }
{ hook run = 'comment_action' comment = $oComment }
</ul>
{ /if }
{ else }
{ $aLang.comment_was_delete }
{ /if }
</section>