Blame view

frontend/views/comment/artbox_comment_form.php 2.42 KB
518c4e3f   Alexey Boroda   -Article with com...
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
  <?php
      use artbox\webcomment\models\CommentModel;
      use artbox\webcomment\models\RatingModel;
      use yii\base\Model;
      use yii\helpers\Html;
      use yii\helpers\Url;
      use yii\web\View;
      use yii\widgets\ActiveForm;
      
      /**
       * @var CommentModel     $comment_model
       * @var array            $form_params
       * @var Model            $model
       * @var string           $formId
       * @var View             $this
       * @var RatingModel|NULL $rating_model
       */
      $form = ActiveForm::begin(
          [
              'id'     => $formId,
              'action' => Url::to(
                  [
                      'artbox-comment/default/create',
                      'entity' => $comment_model->encryptedEntity,
                  ]
              ),
          ]
      );
  ?>
    <div class="form-comm-wr">
99b10610   Eugeny Galkovskiy   Блог
31
        <h4 class="text-uppercase">Оставить комментарий</h4>
518c4e3f   Alexey Boroda   -Article with com...
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        <?php
            if (!empty($rating_model)) {
                ?>
              <div class="input_bl stars-wr_">
                  <?php
                      echo $form->field($rating_model, 'value', [ 'enableClientValidation' => false ])
                                ->hiddenInput()
                                ->label(false);
                      echo Html::tag(
                          'div',
                          '',
                          [
                              'class'                  => 'rateit',
                              'data-rateit-backingfld' => '#' . Html::getInputId($rating_model, 'value'),
                          ]
                      );
                  ?>
              </div>
                <?php
            }
            if (\Yii::$app->user->isGuest) {
                echo $form->field($comment_model, 'username', [ 'options' => [ 'class' => 'form-group input_bl' ] ])
                          ->textInput();
                echo $form->field($comment_model, 'email', [ 'options' => [ 'class' => 'form-group input_bl' ] ])
99b10610   Eugeny Galkovskiy   Блог
56
                          ->textInput([ 'options' => [ 'class' => 'form-control' ] ]);
518c4e3f   Alexey Boroda   -Article with com...
57
58
59
60
61
62
            }
            echo $form->field($comment_model, 'text', [ 'options' => [ 'class' => 'form-group input_bl area_bl' ] ])
                      ->textarea();
            echo Html::tag(
                'div',
                Html::submitButton(
99b10610   Eugeny Galkovskiy   Блог
63
                  Yii::t('app', '<i class="fa fa-comment-o"></i> Отправить')
518c4e3f   Alexey Boroda   -Article with com...
64
65
66
67
68
69
70
71
                ),
                [ 'class' => 'input_bl submit_btn' ]
            );
        ?>
    </div>
  <?php
      ActiveForm::end();
  ?>