Blame view

common/modules/comment/widgets/views/form-comment-answer.php 2.6 KB
b5becf98   Yarik   test
1
2
3
4
5
6
7
8
9
10
11
  <?php
      /**
       * @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
       */
      use yii\widgets\ActiveForm;
      use yii\helpers\Html;
  
  ?>
8eab7c9f   Yarik   test
12
13
14
15
16
17
18
  <?php
      if(!empty( $dataProvider )) {
          ?>
          <div class="new-portf-comm-count">Вопросов: <?= $dataProvider->totalCount ?></div>
          <?php
      }
  ?>
b5becf98   Yarik   test
19
20
21
22
23
  
  <div class="new-portf-add-comm style">
  
      <?php
          $form = ActiveForm::begin();
8eab7c9f   Yarik   test
24
25
26
27
28
29
30
31
32
33
34
35
          if(!$model->isNewRecord) {
              echo $form->field($model, 'comment_id')
                        ->hiddenInput()
                        ->label(false)
                        ->error(false);
          }
          if(!empty($model->comment_pid)) {
              echo $form->field($model, 'comment_pid')
                        ->hiddenInput()
                        ->label(false)
                        ->error(false);
          }
b5becf98   Yarik   test
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
          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();
          }
  
      ?>
d7f5a86c   Yarik   test
58
      <div class="artbox_comment_reply_block artbox_comment_reply_answer_block"></div>
b5becf98   Yarik   test
59
60
61
62
63
64
65
66
67
68
      <?php
  
          echo $form->field($model, 'text', [
              'options'      => [
                  'class' => 'input-blocks-comm area-comm',
              ],
              'inputOptions' => [
                  'class' => 'custom-area-4',
              ],
          ])
d7f5a86c   Yarik   test
69
                    ->label($model->isNewRecord?'Вопрос':'Ответ', ['class' => 'artbox_comment_answer_label'])
b5becf98   Yarik   test
70
71
72
                    ->textarea();
      ?>
      <div class="input-blocks-comm-button style">
8eab7c9f   Yarik   test
73
74
75
76
77
78
79
          <?php
              if($model->isNewRecord) {
                  echo Html::submitButton('Добавить комментарий');
              } else {
                  echo Html::submitButton('Обновить комментарий', [ 'class' => 'artbox_comment_update_answer_submit' ]);
              }
          ?>
b5becf98   Yarik   test
80
81
82
83
84
      </div>
      <?php
          $form->end();
      ?>
  </div>