From e47fd3afe5c7fccc25eb2d1a4a730dbb2ec7d020 Mon Sep 17 00:00:00 2001 From: Denis Shakhov Date: Fri, 15 Jul 2016 12:17:53 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B5=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены отдельные шаблоны для действий и инфы для удобства добавления пунктов через плагины --- .../comment/comment-actions-item.tpl | 16 ++++++++++++ .../components/comment/comment-info-item.tpl | 16 ++++++++++++ .../frontend/components/comment/comment.tpl | 25 ++++++++----------- .../components/comment/component.json | 2 ++ 4 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 application/frontend/components/comment/comment-actions-item.tpl create mode 100644 application/frontend/components/comment/comment-info-item.tpl 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": {