diff --git a/application/frontend/components/comment/comment-actions-item.tpl b/application/frontend/components/comment/comment-actions-item.tpl new file mode 100644 index 00000000..f433b46e --- /dev/null +++ b/application/frontend/components/comment/comment-actions-item.tpl @@ -0,0 +1,16 @@ +{** + * Действие + *} + +{$component = 'ls-comment-actions-item'} +{component_define_params params=[ 'text', 'link', 'mods', 'classes', 'attributes' ]} + +
  • + {if $link} + + {$text} + + {else} + {$text} + {/if} +
  • \ No newline at end of file diff --git a/application/frontend/components/comment/comment-info-item.tpl b/application/frontend/components/comment/comment-info-item.tpl new file mode 100644 index 00000000..c9445d9c --- /dev/null +++ b/application/frontend/components/comment/comment-info-item.tpl @@ -0,0 +1,16 @@ +{** + * Пункт с информацией + *} + +{$component = 'ls-comment-info-item'} +{component_define_params params=[ 'text', 'link', 'mods', 'classes', 'attributes' ]} + +
  • + {if $link} + + {$text} + + {else} + {$text} + {/if} +
  • \ No newline at end of file diff --git a/application/frontend/components/comment/comment.tpl b/application/frontend/components/comment/comment.tpl index 0fd28b1d..e89fd3b5 100644 --- a/application/frontend/components/comment/comment.tpl +++ b/application/frontend/components/comment/comment.tpl @@ -99,11 +99,10 @@ {hook run='comment_info_begin' params=$params} {* Автор комментария *} -
  • - - {$user->getDisplayName()} - -
  • + {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()} -
  • +
  • {/if} {* Прокрутка к дочернему комментарию *} -
  • +
  • {/if} {* Голосование *} @@ -204,11 +203,9 @@ {* Удалить *} {if $oUserCurrent && $comment->IsAllowDelete()} -
  • - - {( $isDeleted ) ? $aLang.comments.comment.restore : $aLang.common.remove} - -
  • + {component 'comment.actions-item' + link=[ classes => 'js-comment-remove', attributes => [ 'data-id' => $commentId ] ] + text=(( $isDeleted ) ? $aLang.comments.comment.restore : $aLang.common.remove)} {/if} {* @hook Конец списка экшенов комментария *} diff --git a/application/frontend/components/comment/component.json b/application/frontend/components/comment/component.json index 77477552..02c641c2 100644 --- a/application/frontend/components/comment/component.json +++ b/application/frontend/components/comment/component.json @@ -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": {