Blame view

common/modules/comment/widgets/views/_review_comment_view.php 2.48 KB
83b0052c   Yarik   test
1
2
  <?php
      use common\models\User;
8a551494   Yarik   test
3
      use common\modules\comment\widgets\CommentWidget;
83b0052c   Yarik   test
4
      use yii\helpers\Html;
8a551494   Yarik   test
5
      use yii\web\View;
83b0052c   Yarik   test
6
7
  
      /**
8a551494   Yarik   test
8
       * @var View                                   $this
83b0052c   Yarik   test
9
10
11
12
13
14
15
16
       * @var \common\modules\comment\models\Comment $model  Current comment model
       * @var integer                                $key    ID of current comment
       * @var integer                                $index  index of current element according
       *      to current page, starting from 0
       * @var \yii\widgets\ListView                  $widget current ListView instance
       * @var User                                   $user
       */
      $user = $model->user;
25bd78f8   Yarik   test
17
      $model->buildButtons(['delete']);
83b0052c   Yarik   test
18
  ?>
25bd78f8   Yarik   test
19
20
21
      <div class="comments-name <?= CommentWidget::$baseClass[ 'comment_author' ] ?>">
          <?= $model->getAuthor(' (Гость)') ?>
      </div>
83b0052c   Yarik   test
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  <?php
      /* == STATUS PRO ==
      ?>
      <div class="comments-status"><span>Pro</span></div>
      <?php
      */
  ?>
      <div class="comments-date"><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></div>
  <?php
      if(!empty( $model->rating )) {
          ?>
          <div class="rating">
              <!--оценка-->
              <input type="hidden" class="val" value="<?= $model->rating->value ?>"/>
          </div>
          <?php
      }
  ?>
      <div class="comments-content">
          <?= $model->text ?>
      </div>
0c0cdc9d   Yarik   test
43
44
      <div>
          <?php
8a551494   Yarik   test
45
              if(!empty( $model->buttons[ 'delete' ] )) {
25bd78f8   Yarik   test
46
                  echo Html::a(($model->user_id != NULL && $model->user_id == \Yii::$app->user->id)?'Удалить':'Пожаловаться   ', $model->buttons[ 'delete' ], [ 'class' => CommentWidget::$baseClass[ 'comment_delete' ] ]);
8a551494   Yarik   test
47
48
49
50
51
52
              }
              if(!empty( $model->buttons[ 'update' ] )) {
                  echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => CommentWidget::$baseClass[ 'comment_update' ] ]);
              }
              if(!empty( $model->buttons[ 'reply' ] )) {
                  echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] ]);
0c0cdc9d   Yarik   test
53
54
55
              }
          ?>
      </div>
83b0052c   Yarik   test
56
  <?php
8a551494   Yarik   test
57
58
59
60
61
62
63
64
65
      if(!$model->isNewRecord) {
          $this->registerJs("$('div.rating').rating(
              {
                  fx : 'full', readOnly : 'true', url : 'rating.php'
              }
          );");
      }
  ?>
  <?php
83b0052c   Yarik   test
66
67
68
69
70
71
      /* == PROJECT INFO ==
      ?>
      <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div>
      <?php
      */
  ?>