1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-07 03:18:20 +03:00

Доработка комментариев

Добавлены отдельные шаблоны для действий и инфы для удобства добавления пунктов через плагины
This commit is contained in:
Denis Shakhov 2016-07-15 12:17:53 +07:00
parent 05bbd5d232
commit e47fd3afe5
4 changed files with 45 additions and 14 deletions

View file

@ -0,0 +1,16 @@
{**
* Действие
*}
{$component = 'ls-comment-actions-item'}
{component_define_params params=[ 'text', 'link', 'mods', 'classes', 'attributes' ]}
<li class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
{if $link}
<a href="{$link.url|default:'#'}" class="ls-link-dotted {$link.classes}" {cattr list=$link.attributes}>
{$text}
</a>
{else}
{$text}
{/if}
</li>

View file

@ -0,0 +1,16 @@
{**
* Пункт с информацией
*}
{$component = 'ls-comment-info-item'}
{component_define_params params=[ 'text', 'link', 'mods', 'classes', 'attributes' ]}
<li class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
{if $link}
<a href="{$link.url|default:'#'}" class="{$link.classes}" {cattr list=$link.attributes}>
{$text}
</a>
{else}
{$text}
{/if}
</li>

View file

@ -99,11 +99,10 @@
{hook run='comment_info_begin' params=$params}
{* Автор комментария *}
<li class="{$component}-username">
<a href="{$user->getUserWebPath()}">
{$user->getDisplayName()}
</a>
</li>
{component 'comment.info-item'
classes="{$component}-username"
link=[ url => $user->getUserWebPath() ]
text=$user->getDisplayName()}
{* Дата добавления комментария *}
{* Так же является ссылкой на комментарий *}
@ -118,13 +117,13 @@
{* Прокрутка к родительскому комментарию *}
{if $useScroll|default:true}
{if $comment->getPid()}
<li class = "{$component}-scroll-to {$component}-scroll-to-parent js-comment-scroll-to-parent"
title = "{$aLang.comments.comment.scroll_to_parent}">↑</li>
<li class="{$component}-scroll-to {$component}-scroll-to-parent js-comment-scroll-to-parent"
title="{$aLang.comments.comment.scroll_to_parent}">↑</li>
{/if}
{* Прокрутка к дочернему комментарию *}
<li class = "{$component}-scroll-to {$component}-scroll-to-child js-comment-scroll-to-child"
title = "{$aLang.comments.comment.scroll_to_child}">↓</li>
<li class="{$component}-scroll-to {$component}-scroll-to-child js-comment-scroll-to-child"
title="{$aLang.comments.comment.scroll_to_child}">↓</li>
{/if}
{* Голосование *}
@ -204,11 +203,9 @@
{* Удалить *}
{if $oUserCurrent && $comment->IsAllowDelete()}
<li>
<a href="#" class="ls-link-dotted js-comment-remove" data-id="{$commentId}">
{( $isDeleted ) ? $aLang.comments.comment.restore : $aLang.common.remove}
</a>
</li>
{component 'comment.actions-item'
link=[ classes => 'js-comment-remove', attributes => [ 'data-id' => $commentId ] ]
text=(( $isDeleted ) ? $aLang.comments.comment.restore : $aLang.common.remove)}
{/if}
{* @hook Конец списка экшенов комментария *}

View file

@ -14,6 +14,8 @@
"tree": "comment-tree.tpl",
"comments": "comments.tpl",
"comment": "comment.tpl",
"actions-item": "comment-actions-item.tpl",
"info-item": "comment-info-item.tpl",
"toolbar": "toolbar.comment.tpl"
},
"scripts": {