adding forgotten files
This commit is contained in:
80
backend/modules/questionnaire/views/question/_form.php
Normal file
80
backend/modules/questionnaire/views/question/_form.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
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,
|
||||
[
|
||||
'data' => \yii\helpers\ArrayHelper::map(\common\models\QuestionType::find()->all(),'id', 'question_type'),
|
||||
'options' => ['placeholder' => '...','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'questionnaire_id')->widget(Select2::class,
|
||||
[
|
||||
'data' => \yii\helpers\ArrayHelper::map(\common\models\Questionnaire::find()->all(),'id', 'title'),
|
||||
'options' => ['placeholder' => '...','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]
|
||||
); ?>
|
||||
|
||||
<!-- <?//= $form->field($model, 'question_type_id')->textInput() ?> -->
|
||||
|
||||
<!-- <?//= $form->field($model, 'questionnaire_id')->textInput() ?> -->
|
||||
|
||||
<?= $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(
|
||||
$model->statuses,
|
||||
[
|
||||
'prompt' => 'Выберите'
|
||||
]
|
||||
) ?>
|
||||
|
||||
<!-- <?//= $form->field($model, 'created_at')->textInput() ?> -->
|
||||
|
||||
<!-- <?//= $form->field($model, 'updated_at')->textInput() ?> -->
|
||||
|
||||
<?= $form->field($model, 'time_limit')->dropDownList(
|
||||
[
|
||||
'' => 'Не ограничено',
|
||||
'30' => '30 секунд',
|
||||
'60' => '1 минута',
|
||||
'90' => '1:30 секунд',
|
||||
'120' => '2 минуты',
|
||||
'180' => '3 минуты',
|
||||
'300' => '5 минут',
|
||||
'600' => '10 минут',
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'score')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
47
backend/modules/questionnaire/views/question/_search.php
Normal file
47
backend/modules/questionnaire/views/question/_search.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\questionnaire\models\QuestionSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="question-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'question_type_id') ?>
|
||||
|
||||
<?= $form->field($model, 'questionnaire_id') ?>
|
||||
|
||||
<?= $form->field($model, 'question_body') ?>
|
||||
|
||||
<?= $form->field($model, 'question_priority') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'next_question') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'status') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'score') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'time_limit') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
18
backend/modules/questionnaire/views/question/create.php
Normal file
18
backend/modules/questionnaire/views/question/create.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\questionnaire\models\Question */
|
||||
|
||||
$this->title = 'Создание вопроса';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Questions', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="question-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
73
backend/modules/questionnaire/views/question/index.php
Normal file
73
backend/modules/questionnaire/views/question/index.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\questionnaire\models\QuestionSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Список вопросов';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="question-index">
|
||||
|
||||
<!-- <h1>-->
|
||||
<!-- <?//= Html::encode($this->title) ?> -->
|
||||
<!-- </h1>-->
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать вопрос', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
// 'id',
|
||||
'question_body',
|
||||
[
|
||||
'attribute' => 'question_type_id',
|
||||
'value' => function($model){
|
||||
return $model->getQuestionTitle();
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'questionnaire_id',
|
||||
'value' => function($model){
|
||||
return $model->getQuestionnaireTitle();
|
||||
}
|
||||
],
|
||||
'question_priority',
|
||||
'next_question',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return \yii\helpers\Html::tag(
|
||||
'span',
|
||||
$model->status ? 'Active' : 'Not Active',
|
||||
[
|
||||
'class' => 'label label-' . ($model->status ? 'success' : 'danger'),
|
||||
]
|
||||
);
|
||||
},
|
||||
],
|
||||
//'created_at',
|
||||
//'updated_at',
|
||||
[
|
||||
'attribute' => 'time_limit',
|
||||
'value' => function($model){
|
||||
return $model->limitTime;
|
||||
}
|
||||
],
|
||||
'score',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
19
backend/modules/questionnaire/views/question/update.php
Normal file
19
backend/modules/questionnaire/views/question/update.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\questionnaire\models\Question */
|
||||
|
||||
$this->title = 'Изменение вопроса: ' . $model->question_body;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Questions', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="question-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
72
backend/modules/questionnaire/views/question/view.php
Normal file
72
backend/modules/questionnaire/views/question/view.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\questionnaire\models\Question */
|
||||
|
||||
$this->title = $model->question_body;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Questions', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="question-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index'], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
[
|
||||
'attribute' => 'question_type_id',
|
||||
'value' => function($model){
|
||||
return $model->getQuestionTitle();
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'questionnaire_id',
|
||||
'value' => function($model){
|
||||
return $model->getQuestionnaireTitle();
|
||||
}
|
||||
],
|
||||
'question_body',
|
||||
'question_priority',
|
||||
'next_question',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return \yii\helpers\Html::tag(
|
||||
'span',
|
||||
$model->status ? 'Active' : 'Not Active',
|
||||
[
|
||||
'class' => 'label label-' . ($model->status ? 'success' : 'danger'),
|
||||
]
|
||||
);
|
||||
},
|
||||
],
|
||||
'created_at',
|
||||
'updated_at',
|
||||
[
|
||||
'attribute' => 'time_limit',
|
||||
'value' => function($model){
|
||||
return $model->limitTime;
|
||||
}
|
||||
],
|
||||
'score'
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user