1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-16 21:34:25 +03:00
ifhub.club/application/frontend/skin/developer/comments/comment.tpl

110 lines
4.7 KiB
Smarty
Raw Normal View History

2013-05-23 20:15:54 +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()}
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}</a> &rarr;
<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}
{* Комментарий *}
<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}
2013-05-23 20:15:54 +03:00
{if $oComment->getDelete()}
comment-deleted
{elseif $oUserCurrent and $oComment->getUserId() == $oUserCurrent->getId()}
2013-05-23 20:15:54 +03:00
comment-self
{elseif $sDateReadLast <= $oComment->getDate()}
2013-05-23 20:15:54 +03:00
comment-new
{/if}
{else}
comment-list-item
{/if}">
{if ! $oComment->getDelete() or ($oUserCurrent and $oUserCurrent->isAdministrator())}
2013-05-23 20:15:54 +03:00
{* Аватар пользователя *}
<a href="{$oUser->getUserWebPath()}">
<img src="{$oUser->getProfileAvatarPath(48)}" alt="{$oUser->getDisplayName()}" class="comment-avatar" />
2013-05-23 20:15:54 +03:00
</a>
2013-05-23 20:15:54 +03:00
{* Информация *}
<ul class="comment-info">
2013-05-23 20:15:54 +03:00
{* Автор комментария *}
<li class="comment-username {if $iAuthorId == $oUser->getId()}comment-username-author{/if}" title="{if $sAuthorNotice}{$sAuthorNotice}{/if}">
<a href="{$oUser->getUserWebPath()}">{$oUser->getDisplayName()}</a>
</li>
2013-05-23 20:15:54 +03:00
{* Дата *}
<li class="comment-date">
<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}">
<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>
</a>
2011-04-01 10:49:36 +03:00
</li>
{* Прокрутка к родительскии/дочернии комментариям *}
2013-05-23 20:15:54 +03:00
{if ! $bList and $oComment->getPid()}
<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>
{/if}
2013-05-23 20:15:54 +03: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>
{/if}
{* Избранное *}
2013-05-23 20:15:54 +03:00
{if $oUserCurrent and ! $bNoCommentFavourites}
<li>{include 'favourite.tpl' sFavouriteType='comment' oFavouriteObject=$oComment}</li>
{/if}
</ul>
2013-05-23 20:15:54 +03: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
{* Кнопки ответа, удаления и т.д. *}
{if $oUserCurrent}
<ul class="comment-actions">
2013-05-23 20:15:54 +03:00
{if ! $bList and ! $oComment->getDelete() and ! $bAllowNewComment}
<li><a href="#" class="link-dotted js-comment-reply" data-id="{$oComment->getId()}">{$aLang.comments.comment.reply}</a></li>
{/if}
<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>
{/if}
{hook run='comment_action' comment=$oComment}
</ul>
{/if}
{else}
{$aLang.comments.comment.deleted}
{/if}
</section>