guild/backend/modules/questionnaire/views/question/_form.php

73 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2021-10-22 17:02:28 +03:00
<?php
2021-11-08 12:41:39 +03:00
use backend\components\timepicker\src\TimePicker;
use backend\modules\questionnaire\models\Questionnaire;
use backend\modules\questionnaire\models\QuestionType;
use common\helpers\StatusHelper;
2021-10-22 17:02:28 +03:00
use kartik\select2\Select2;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\questionnaire\models\Question */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="question-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'question_type_id')->widget(Select2::class,
[
2021-11-08 12:41:39 +03:00
'data' => QuestionType::find()->select(['question_type', 'id'])->indexBy('id')->column(),
2021-10-22 17:02:28 +03:00
'options' => ['placeholder' => '...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]
); ?>
<?= $form->field($model, 'questionnaire_id')->widget(Select2::class,
[
2021-11-08 12:41:39 +03:00
'data' => Questionnaire::find()->select(['title', 'id'])->indexBy('id')->column(),
2021-10-22 17:02:28 +03:00
'options' => ['placeholder' => '...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]
); ?>
<?= $form->field($model, 'question_body')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'question_priority')->textInput() ?>
<?= $form->field($model, 'next_question')->textInput() ?>
<?= $form->field($model, 'status')->dropDownList(
2021-11-08 12:41:39 +03:00
StatusHelper::statusList(),
2021-10-22 17:02:28 +03:00
[
'prompt' => 'Выберите'
]
) ?>
2021-11-08 12:41:39 +03:00
<?= $form->field($model, 'time_limit')->widget(TimePicker::class,
2021-10-22 17:02:28 +03:00
[
'name' => 'time_limit_picker',
'pluginOptions' => [
'showSeconds' => false,
'showMeridian' => false,
'minuteStep' => 1,
'defaultTime' => ''
]
]) ?>
2021-10-22 17:02:28 +03:00
<?= $form->field($model, 'score')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>