Blame view

common/modules/comment/widgets/views/form-comment.php 2.46 KB
b82db04a   Yarik   test
1
2
  <?php
      /**
2d107e9e   Yarik   test
3
4
5
6
       * @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
b82db04a   Yarik   test
7
       */
877ea4b2   Yarik   test
8
      use kartik\rating\StarRating;
b82db04a   Yarik   test
9
10
11
12
13
14
15
      use yii\widgets\ActiveForm;
      use yii\helpers\Html;
  
  ?>
  <div class="new-portf-comm-count">Комментарии: <?= $dataProvider->totalCount ?></div>
  
  <div class="new-portf-add-comm style">
2d107e9e   Yarik   test
16
  
b82db04a   Yarik   test
17
18
      <?php
          $form = ActiveForm::begin();
877ea4b2   Yarik   test
19
20
21
22
23
24
25
26
27
28
          if($rating) {
              echo $form->field(( !empty( $model->rating ) ? $model->rating : $rating ), 'value')
                        ->label(false)
                        ->widget(StarRating::className(), [ 'pluginOptions' => [ 'size'        => 'xxs',
                                                                                 'step'        => 1,
                                                                                 'value'       => 2,
                                                                                 'showCaption' => false,
                        ],
                        ]);
          }
2d107e9e   Yarik   test
29
  
b82db04a   Yarik   test
30
31
          if($model->scenario == $model::SCENARIO_GUEST) {
              echo $form->field($model, 'user_name', [
2d107e9e   Yarik   test
32
                  'options'      => [
b82db04a   Yarik   test
33
34
35
36
37
                      'class' => 'input-blocks-comm',
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
2d107e9e   Yarik   test
38
39
              ])
                        ->textInput();
b82db04a   Yarik   test
40
              echo $form->field($model, 'user_email', [
2d107e9e   Yarik   test
41
                  'options'      => [
b82db04a   Yarik   test
42
43
44
45
46
                      'class' => 'input-blocks-comm',
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
2d107e9e   Yarik   test
47
              ])
877ea4b2   Yarik   test
48
49
                        ->textInput()
                        ->hint('Ваш email не будет доступен к просмотру.');
b82db04a   Yarik   test
50
          }
2d107e9e   Yarik   test
51
52
53
54
55
  
      ?>
      <div class="artbox_comment_reply_block"></div>
      <?php
  
b82db04a   Yarik   test
56
          echo $form->field($model, 'text', [
2d107e9e   Yarik   test
57
              'options'      => [
b82db04a   Yarik   test
58
59
60
61
62
                  'class' => 'input-blocks-comm area-comm',
              ],
              'inputOptions' => [
                  'class' => 'custom-area-4',
              ],
2d107e9e   Yarik   test
63
64
          ])
                    ->textarea();
b82db04a   Yarik   test
65
      ?>
2d107e9e   Yarik   test
66
67
68
69
      <div class="input-blocks-comm-button style">
          <?= Html::submitButton('Добавить комментарий') ?>
      </div>
      <?php
b82db04a   Yarik   test
70
71
72
          $form->end();
      ?>
  </div>