Blame view

common/modules/comment/widgets/views/form-comment-review.php 3.69 KB
83b0052c   Yarik   test
1
2
  <?php
      /**
8a551494   Yarik   test
3
       * @var View                                       $this
83b0052c   Yarik   test
4
5
6
7
8
       * @var \common\modules\comment\models\Comment     $model
       * @var \common\models\User                        $user
       * @var \yii\data\ActiveDataProvider               $dataProvider
       * @var null|\common\modules\comment\models\Rating $rating
       */
8a551494   Yarik   test
9
      use common\modules\comment\widgets\CommentWidget;
d7f5a86c   Yarik   test
10
      use kartik\rating\StarRating;
8a551494   Yarik   test
11
      use yii\web\View;
83b0052c   Yarik   test
12
13
      use yii\widgets\ActiveForm;
      use yii\helpers\Html;
93a7a3c1   Yarik   test
14
  
83b0052c   Yarik   test
15
  ?>
8a551494   Yarik   test
16
17
18
19
20
21
22
23
24
  <?php
      if(!empty( $dataProvider )) {
          ?>
          <div class="workplace-title style">
              <p>Мнения о пользователе: <?= $dataProvider->totalCount ?></p>
          </div>
          <?php
      }
  ?>
83b0052c   Yarik   test
25
26
  <div class="new-portf-add-comm style">
      <?php
282b6e56   Yarik   Commit
27
28
29
30
31
          if(!$model->isNewRecord) {
              $form = ActiveForm::begin(['id' => 'artbox-comment-reply']);
          } else {
              $form = ActiveForm::begin();
          }
8a551494   Yarik   test
32
33
34
35
36
37
38
          if(!$model->isNewRecord) {
              echo $form->field($model, 'comment_id')
                        ->hiddenInput()
                        ->label(false)
                        ->error(false);
          }
          echo $form->field(( !empty( $model->rating ) ? $model->rating : $rating ), 'value')
83b0052c   Yarik   test
39
                    ->label(false)
93a7a3c1   Yarik   test
40
                    ->widget(StarRating::className(), [
282b6e56   Yarik   Commit
41
42
43
                        'options' => [
                            'id' => ((!$model->isNewRecord)?'rating-value-reply':'rating-value'),
                        ],
93a7a3c1   Yarik   test
44
45
46
47
48
49
50
51
52
53
                        'pluginOptions' => [
                            'size'        => 'xxs',
                            'step'        => 1,
                            'value'       => 2,
                            'showCaption' => false,
                            'stars'       => 10,
                            'min'         => 0,
                            'max'         => 10,
                        ],
                    ]);
83b0052c   Yarik   test
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
          if($model->scenario == $model::SCENARIO_GUEST) {
              echo $form->field($model, 'user_name', [
                  'options'      => [
                      'class' => 'input-blocks-comm',
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
              ])
                        ->textInput();
              echo $form->field($model, 'user_email', [
                  'options'      => [
                      'class' => 'input-blocks-comm',
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
              ])
                        ->textInput();
          }
8a551494   Yarik   test
74
          if(!empty( $model->comment_pid )) {
8eab7c9f   Yarik   test
75
              echo Html::tag('div', Html::activeHiddenInput($model, 'comment_pid') . Html::tag('p', $model->parent->author, [ 'class' => 'artbox_comment_reply_author' ]), [ 'class' => CommentWidget::$baseClass[ 'reply_block' ] ]);
8a551494   Yarik   test
76
          } else {
93a7a3c1   Yarik   test
77
              echo Html::tag('div', '', [ 'class' => CommentWidget::$baseClass[ 'reply_block' ] . ' test_class' ]);
8a551494   Yarik   test
78
          }
83b0052c   Yarik   test
79
80
81
82
83
84
85
86
87
88
89
          echo $form->field($model, 'text', [
              'options'      => [
                  'class' => 'input-blocks-comm area-comm',
              ],
              'inputOptions' => [
                  'class' => 'custom-area-4',
              ],
          ])
                    ->textarea();
      ?>
      <div class="input-blocks-comm-button style">
8a551494   Yarik   test
90
91
92
93
94
95
96
          <?php
              if($model->isNewRecord) {
                  echo Html::submitButton('Добавить комментарий');
              } else {
                  echo Html::submitButton('Обновить комментарий', [ 'class' => CommentWidget::$baseClass[ 'comment_update_submit' ] ]);
              }
          ?>
83b0052c   Yarik   test
97
98
99
100
101
      </div>
      <?php
          $form->end();
      ?>
  </div>