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

View file

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