Blame view

common/modules/comment/widgets/views/form-comment.php 2.54 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
          if($rating) {
              echo $form->field(( !empty( $model->rating ) ? $model->rating : $rating ), 'value')
                        ->label(false)
93a7a3c1   Yarik   test
22
23
24
25
26
27
28
29
30
31
                        ->widget(StarRating::className(), [
                            'pluginOptions' => [
                                'size'        => 'xxs',
                                'step'        => 1,
                                'value'       => 2,
                                'showCaption' => false,
                                'min'         => 0,
                                'max'         => 10,
                                'stars'       => 10,
                            ],
877ea4b2   Yarik   test
32
33
                        ]);
          }
2d107e9e   Yarik   test
34
  
b82db04a   Yarik   test
35
36
          if($model->scenario == $model::SCENARIO_GUEST) {
              echo $form->field($model, 'user_name', [
2d107e9e   Yarik   test
37
                  'options'      => [
6b42222c   Виталий   git
38
                      'class' => 'input-blocks-comm fix_marg_',
b82db04a   Yarik   test
39
40
41
42
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
2d107e9e   Yarik   test
43
44
              ])
                        ->textInput();
b82db04a   Yarik   test
45
              echo $form->field($model, 'user_email', [
2d107e9e   Yarik   test
46
                  'options'      => [
b82db04a   Yarik   test
47
48
49
50
51
                      'class' => 'input-blocks-comm',
                  ],
                  'inputOptions' => [
                      'class' => 'custom-input-4',
                  ],
2d107e9e   Yarik   test
52
              ])
877ea4b2   Yarik   test
53
54
                        ->textInput()
                        ->hint('Ваш email не будет доступен к просмотру.');
b82db04a   Yarik   test
55
          }
2d107e9e   Yarik   test
56
57
58
59
60
  
      ?>
      <div class="artbox_comment_reply_block"></div>
      <?php
  
b82db04a   Yarik   test
61
          echo $form->field($model, 'text', [
2d107e9e   Yarik   test
62
              'options'      => [
b82db04a   Yarik   test
63
64
65
66
67
                  'class' => 'input-blocks-comm area-comm',
              ],
              'inputOptions' => [
                  'class' => 'custom-area-4',
              ],
2d107e9e   Yarik   test
68
69
          ])
                    ->textarea();
b82db04a   Yarik   test
70
      ?>
2d107e9e   Yarik   test
71
72
73
74
      <div class="input-blocks-comm-button style">
          <?= Html::submitButton('Добавить комментарий') ?>
      </div>
      <?php
b82db04a   Yarik   test
75
76
77
          $form->end();
      ?>
  </div>