Blame view

common/modules/comment/widgets/views/project_comment_view.php 2.27 KB
b82db04a   Yarik   test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  <?php
      use common\models\User;
      use yii\helpers\Html;
  
      /**
       * @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 = NULL;
      if(!empty( $model->user_id )) {
          $user = User::find()
                      ->where([ 'id' => $model->user_id ])
                      ->with('userInfo')
                      ->one();
      }
  ?>
  <div class="new-portf-comm-read">
      <div class="style">
          <div class="header-cabinet-foto">
              <?php
                  if(!empty( $user ) && !empty( $user->userInfo->image )) {
                      echo "<img src='{$user->userInfo->image}' alt=''>";
                  } else {
                      echo "<img src='/images/ded-ico.png' alt=''>";
                  }
              ?>
          </div>
          <div class="new-prof-wrapper-read">
              <div class="new-portf-comm-read-title">
                  <?php
                  if(!empty($user)) {
                      echo Html::a($user->firstname . ' ' . $user->lastname, [
                          'performer/common',
                          'performer_id' => $user->id,
                      ]);
                  } else {
                      echo $model->user_name . '(Гость)';
                  }
                  ?>
              </div>
              <div class="new-portf-comm-read-rating">
                  <div class="rating">
                      <!--оценка-->
                      <input type="hidden" class="val" value="3"/>
                      <!--количество голосов-->
                      <input type="hidden" class="votes" value="12"/>
                  </div>
              </div>
              <div class="blog-post-date">
                  <span></span>
                  <p><?= date('d.m.Y', strtotime($model->date_add)) ?></p>
              </div>
          </div>
  
          <div class="new-portf-answer">
              <?= Html::encode($model->text) ?>
          </div>
  
      </div>
      <div class="style"></div>
  </div>