Blame view

common/modules/comment/widgets/views/project_comment_view.php 3.4 KB
3f2bc3d0   Administrator   first commit
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  <?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 artbox_comment_container" data-comment_id="<?= $model->comment_id ?>" data-form_name="<?= $model->formName() ?>">

      <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('<span class="artbox_comment_author">' . $user->firstname . ' ' . $user->lastname . '</span>', [

                              'performer/common',

                              'performer_id' => $user->id,

                          ]);

                      } else {

                          echo '<span class="artbox_comment_author">' . $model->user_name . '</span>' . '(Гость)';

                      }

                  ?>

              </div>

              <div class="new-portf-comm-read-rating">

                  <?php

                      if($rating = $model->hasRating()) {

                          ?>

                          <div class="rating">

                              <!--оценка-->

                              <input type="hidden" class="val" value="<?= $rating->value ?>"/>

                              <!--количество голосов-->

                              <input type="hidden" class="votes" value="1"/>

                          </div>

                          <?php

                      }

                  ?>

              </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 artbox_comment_text">

              <?= Html::encode($model->text) ?>

          </div>

          <div style="clear:both"></div>

          <?php

              /*

              ?>

              <div class="action_panel">

                  <ul>

                      <li style="display:inline-block" class="artbox_comment_reply">Ответить</li>

                      <li style="display:inline-block" class="artbox_comment_update">Редактировать</li>

                      <li style="display:inline-block" class="artbox_comment_delete">Удалить</li>

                  </ul>

              </div>

              <?php

              */

          ?>

      </div>

      <div class="style"></div>

  </div>