1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 01:14:24 +03:00
ifhub.club/application/frontend/skin/developer/components/wall/wall.posts.tpl
2014-11-06 23:51:24 +07:00

41 lines
1.6 KiB
Smarty

{**
* Список постов на стене
*
* @param array $posts Список постов
*}
{foreach $smarty.local.posts as $post}
{$comments = $post->getLastReplyWall()}
{$postId = $post->getId()}
{* Запись *}
{include './wall.entry.tpl' entry=$post showReply=!$comments classes='wall-post js-wall-post' type='post'}
{* Комментарии *}
<div class="wall-comments js-wall-comment-wrapper" data-id="{$postId}">
{* Кнопка подгрузки комментариев *}
{if count( $comments ) < $post->getCountReply()}
{include 'components/more/more.tpl'
classes = 'wall-more-comments js-wall-more-comments'
count = $post->getCountReply() - Config::Get('module.wall.count_last_reply')
append = 'false'
attributes = [
'data-more-target' => ".js-wall-entry-container[data-id={$postId}]",
'data-proxy-last_id' => $comments[0]->getId(),
'data-param-target_id' => $postId
]}
{/if}
{* Комментарии *}
<div class="js-wall-entry-container" data-id="{$postId}">
{if $comments}
{include './wall.comments.tpl' comments=$comments}
{/if}
</div>
{* Форма добавления комментария *}
{if $oUserCurrent}
{include './wall.form.tpl' id=$postId display=$comments placeholder=$aLang.wall.form.fields.text.placeholder_reply}
{/if}
</div>
{/foreach}