a2cde075
Yarik
first commit
|
1
|
<?php
|
faff2c48
Yarik
Artbox comment cr...
|
2
|
use artbox\webcomment\models\CommentModel;
|
a2cde075
Yarik
first commit
|
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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
*/
$text_input_id = Html::getInputId($comment_model, 'text') . '-reply';
|
faff2c48
Yarik
Artbox comment cr...
|
17
|
$parent_id_input_id = Html::getInputId($comment_model, 'parent_id') . '-reply';
|
a2cde075
Yarik
first commit
|
18
19
20
21
|
$text_input_selectors = [
'container' => '.field-' . $text_input_id,
'input' => '#' . $text_input_id,
];
|
faff2c48
Yarik
Artbox comment cr...
|
22
23
24
|
$parent_id_input_selectors = [
'container' => '.field-' . $parent_id_input_id,
'input' => '#' . $parent_id_input_id,
|
a2cde075
Yarik
first commit
|
25
26
27
28
29
30
31
32
33
34
35
|
];
$form = ActiveForm::begin([
'id' => $formId . '-reply',
'action' => Url::to([
'artbox-comment/default/create',
'entity' => $comment_model->encryptedEntity,
]),
]);
?>
<div class="answer-form">
<?php
|
faff2c48
Yarik
Artbox comment cr...
|
36
37
38
39
40
|
echo $form->field(
$comment_model,
'parent_id',
[
'selectors' => $parent_id_input_selectors,
|
a2cde075
Yarik
first commit
|
41
|
'inputOptions' => [
|
faff2c48
Yarik
Artbox comment cr...
|
42
|
'id' => $parent_id_input_id,
|
a2cde075
Yarik
first commit
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
'class' => 'form-control',
],
])
->hiddenInput()
->label(false);
echo $form->field($comment_model, 'text', [
'selectors' => $text_input_selectors,
'inputOptions' => [
'id' => $text_input_id,
'class' => 'form-control',
'cols' => 30,
'rows' => 10,
],
])
->textarea();
echo Html::submitButton(Yii::t('artbox-comment', 'Submit'));
echo Html::button(Yii::t('artbox-comment', 'Cancel'), [ 'data-action' => 'reply-cancel' ]);
?>
</div>
<?php
ActiveForm::end();
?>
|