Commit f295c85bab00fd895b5c1ba4edec1db638ba9fce

Authored by Yarik
1 parent 70d00c60

test

common/modules/comment/widgets/views/_question_comment_view.php
... ... @@ -21,49 +21,51 @@
21 21 ]);
22 22 }
23 23 ?>
24   - <div class="comments-name <?= CommentWidget::$baseClass[ 'comment_author' ] ?>">
25   - <?= $model->getAuthor(' (Гость)') ?>
26   - </div>
27   - <div><?=Html::img(!empty($model->user)?$model->user->userInfo->image:'/images/avatar-bg.png')?></div>
28   -<?php
29   - /* == STATUS PRO ==
30   - ?>
31   - <div class="comments-status"><span>Pro</span></div>
32   - <?php
33   - */
34   -?>
35   - <div class="comments-date"><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></div>
36   - <div class="comments-content">
37   - <?= $model->text ?>
38   - </div>
39   -<?php
40   - if(!empty( $model->child )) {
41   - echo Html::tag('div', $this->render('@common/modules/comment/widgets/views/_question_comment_view', [
42   - 'model' => $model->child,
43   - 'key' => $key,
44   - 'index' => $index,
45   - 'widget' => $widget,
46   - ]), [
47   - 'class' => CommentWidget::$baseClass[ 'comment_container' ],
48   - 'data' => [
49   - 'key' => $model->child->comment_id,
50   - 'form' => $model->formName(),
51   - ],
52   - ]);
53   - }
54   -?>
55   - <div>
  24 + <div class="<?=((!empty($model->child))?'has-child':'')?>">
  25 + <div class="comments-name <?= CommentWidget::$baseClass[ 'comment_author' ] ?>">
  26 + <?= $model->getAuthor(' (Гость)') ?>
  27 + </div>
  28 + <div><?= Html::img(!empty( $model->user ) ? $model->user->minImg($model->user->userInfo->image, 48, 48) : '/images/avatar-bg.png') ?></div>
56 29 <?php
57   - if(!empty( $model->buttons[ 'delete' ] )) {
58   - echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => 'artbox_comment_delete_answer' ]);
59   - }
60   - if(!empty( $model->buttons[ 'update' ] )) {
61   - echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => 'artbox_comment_update_answer' ]);
62   - }
63   - if(!empty( $model->buttons[ 'reply' ] )) {
64   - echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ].' artbox_comment_reply_answer' ]);
  30 + /* == STATUS PRO ==
  31 + ?>
  32 + <div class="comments-status"><span>Pro</span></div>
  33 + <?php
  34 + */
  35 + ?>
  36 + <div class="comments-date"><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></div>
  37 + <div class="comments-content">
  38 + <?= $model->text ?>
  39 + </div>
  40 + <?php
  41 + if(!empty( $model->child )) {
  42 + echo Html::tag('div', $this->render('@common/modules/comment/widgets/views/_question_comment_view', [
  43 + 'model' => $model->child,
  44 + 'key' => $key,
  45 + 'index' => $index,
  46 + 'widget' => $widget,
  47 + ]), [
  48 + 'class' => CommentWidget::$baseClass[ 'comment_container' ],
  49 + 'data' => [
  50 + 'key' => $model->child->comment_id,
  51 + 'form' => $model->formName(),
  52 + ],
  53 + ]);
65 54 }
66 55 ?>
  56 + <div>
  57 + <?php
  58 + if(!empty( $model->buttons[ 'delete' ] )) {
  59 + echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => 'artbox_comment_delete_answer' ]);
  60 + }
  61 + if(!empty( $model->buttons[ 'update' ] )) {
  62 + echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => 'artbox_comment_update_answer' ]);
  63 + }
  64 + if(!empty( $model->buttons[ 'reply' ] )) {
  65 + echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] . ' artbox_comment_reply_answer' ]);
  66 + }
  67 + ?>
  68 + </div>
67 69 </div>
68 70 <?php
69 71 /* == PROJECT INFO ==
... ...