2013-05-23 20:15:54 +03:00
|
|
|
|
{**
|
|
|
|
|
* Комментарий
|
|
|
|
|
*
|
|
|
|
|
* bAllowNewComment true если разрешно добавлять новые комментарии
|
|
|
|
|
* bOneComment
|
|
|
|
|
* bNoCommentFavourites true если не нужно выводить кнопку добавления в избранное
|
|
|
|
|
* iAuthorId ID автора топика
|
|
|
|
|
* bList true если комментарий выводится в списках (например на странице Избранные комментарии)
|
|
|
|
|
*
|
|
|
|
|
* @styles css/comments.css
|
|
|
|
|
*}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{$oUser = $oComment->getUser()}
|
|
|
|
|
{$oVote = $oComment->getVote()}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
|
|
|
|
|
{* Комментарий *}
|
2012-04-23 13:53:41 +03: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-04-23 13:53:41 +03: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-04-23 13:53:41 +03:00
|
|
|
|
{/if}">
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{if ! $oComment->getDelete() or $bOneComment or ($oUserCurrent and $oUserCurrent->isAdministrator())}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
<a name="comment{$oComment->getId()}"></a>
|
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{* Кнопка сворачивания ветки комментариев *}
|
|
|
|
|
<div class="comment-folding"></div>
|
2012-04-26 20:41:31 +03:00
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{* Аватар пользователя *}
|
|
|
|
|
<a href="{$oUser->getUserWebPath()}">
|
2013-05-27 12:25:56 +03:00
|
|
|
|
<img src="{$oUser->getProfileAvatarPath(24)}" alt="avatar" class="comment-avatar" />
|
2013-05-23 20:15:54 +03:00
|
|
|
|
</a>
|
2012-04-26 20:41:31 +03:00
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{* Информация *}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
<ul class="comment-info">
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{* Автор комментария *}
|
2012-07-03 10:05:27 +03:00
|
|
|
|
<li class="comment-author {if $iAuthorId == $oUser->getId()}comment-topic-author{/if}" title="{if $iAuthorId == $oUser->getId() and $sAuthorNotice}{$sAuthorNotice}{/if}">
|
2013-10-23 10:02:40 +03:00
|
|
|
|
<a href="{$oUser->getUserWebPath()}">{$oUser->getDisplayName()}</a>
|
2012-04-23 13:53:41 +03:00
|
|
|
|
</li>
|
2013-05-23 20:15:54 +03:00
|
|
|
|
|
|
|
|
|
{* Дата *}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
<li class="comment-date">
|
2012-08-03 19:18:02 +03:00
|
|
|
|
<time datetime="{date_format date=$oComment->getDate() format='c'}" title="{date_format date=$oComment->getDate() format="j F Y, H:i"}">
|
|
|
|
|
{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-04-23 13:53:41 +03:00
|
|
|
|
</li>
|
|
|
|
|
|
2013-08-29 12:30:04 +03:00
|
|
|
|
{* Избранное *}
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{if $oUserCurrent and ! $bNoCommentFavourites}
|
2013-08-29 12:30:04 +03:00
|
|
|
|
<li class="favourite comment-favourite js-favourite">
|
|
|
|
|
<div data-favourite-type="comment"
|
|
|
|
|
data-favourite-id="{$oComment->getId()}"
|
|
|
|
|
class="favourite-toggle js-favourite-toggle {if $oUserCurrent && $oComment->getIsFavourite()}active{/if} js-favourite"
|
2013-07-03 08:30:44 +03:00
|
|
|
|
title="{if $oComment->getIsFavourite()}{$aLang.talk_favourite_del}{else}{$aLang.talk_favourite_add}{/if}"></div>
|
2013-08-29 12:30:04 +03:00
|
|
|
|
<span class="favourite-count js-favourite-count">{if $oComment->getCountFavourite() > 0}{$oComment->getCountFavourite()}{/if}</span>
|
2013-05-23 20:15:54 +03:00
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{* Ссылка на комментарий *}
|
|
|
|
|
<li class="comment-link">
|
|
|
|
|
<a href="{if $oConfig->GetValue('module.comment.nested_per_page')}{router page='comments'}{else}#comment{/if}{$oComment->getId()}" title="{$aLang.comment_url_notice}">
|
|
|
|
|
<i class="icon-synio-link"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
{* Ссылки на родительские/дочерние комментарии *}
|
|
|
|
|
{if $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>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<li class="comment-goto comment-goto-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
|
2012-04-23 13:53:41 +03:00
|
|
|
|
|
2013-05-23 20:15:54 +03:00
|
|
|
|
{**
|
|
|
|
|
* Блок голосования
|
|
|
|
|
* Не выводим блок голосования в личных сообщениях и списках
|
|
|
|
|
*}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
{if $oComment->getTargetType() != 'talk'}
|
2013-07-09 11:40:06 +03:00
|
|
|
|
<li data-vote-type="comment"
|
|
|
|
|
data-vote-id="{$oComment->getId()}"
|
|
|
|
|
class="vote js-vote
|
|
|
|
|
{if $oComment->getRating() > 0}
|
|
|
|
|
vote-count-positive
|
|
|
|
|
{elseif $oComment->getRating() < 0}
|
|
|
|
|
vote-count-negative
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{if (strtotime($oComment->getDate()) < $smarty.now - $oConfig->GetValue('acl.vote.comment.limit_time') && ! $oVote) || ($oUserCurrent && $oUserCurrent->getId() == $oUser->getId())}
|
|
|
|
|
vote-expired
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{if $oVote}
|
|
|
|
|
voted
|
|
|
|
|
|
|
|
|
|
{if $oVote->getDirection() > 0}
|
|
|
|
|
voted-up
|
|
|
|
|
{else}
|
|
|
|
|
voted-down
|
|
|
|
|
{/if}
|
|
|
|
|
{/if}">
|
|
|
|
|
<span class="vote-count js-vote-rating">{if $oComment->getRating() > 0}+{/if}{$oComment->getRating()}</span>
|
|
|
|
|
<div class="vote-down js-vote-down"></div>
|
|
|
|
|
<div class="vote-up js-vote-up"></div>
|
2012-04-23 13:53:41 +03:00
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
2013-05-23 20:15:54 +03:00
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
{* Текст комментария *}
|
|
|
|
|
<div id="comment_content_id_{$oComment->getId()}" class="comment-content">
|
|
|
|
|
<div class="text">
|
|
|
|
|
{$oComment->getText()}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{* Выводим ссылки на блог и топик в котором находится комментарий (только в списках) *}
|
|
|
|
|
{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()}" class="comment-path-topic">{$oTopic->getTitle()|escape:'html'}</a>
|
|
|
|
|
<a href="{$oTopic->getUrl()}#comments" class="comment-path-comments">{$oTopic->getCountComment()}</a>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{* Кнопки ответа, удаления и т.д. *}
|
|
|
|
|
{if $oUserCurrent and ! $bList}
|
|
|
|
|
<ul class="comment-actions">
|
|
|
|
|
{if ! $oComment->getDelete() and ! $bAllowNewComment}
|
2012-04-23 13:53:41 +03: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-04-23 13:53:41 +03: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}
|
2013-05-23 20:15:54 +03:00
|
|
|
|
</ul>
|
|
|
|
|
{/if}
|
2012-04-23 13:53:41 +03:00
|
|
|
|
{else}
|
|
|
|
|
{$aLang.comment_was_delete}
|
|
|
|
|
{/if}
|
|
|
|
|
</section>
|