changing foreign key in user_response from id to uuid, completed add greedy loading, some refactoring
This commit is contained in:
@ -8,20 +8,11 @@ use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\questionnaire\models\UserResponse */
|
||||
/* @var $responseDataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title =cut_title($model->response_body);
|
||||
$this->title = $model->response_body;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'User Responses', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
YiiAsset::register($this);
|
||||
|
||||
function cut_title($str)
|
||||
{
|
||||
if(strlen($str) > 40){
|
||||
return mb_substr($str, 0, 40, 'UTF-8') . '...';
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
<div class="user-response-view">
|
||||
|
||||
@ -42,22 +33,20 @@ function cut_title($str)
|
||||
'attributes' => [
|
||||
'id',
|
||||
[
|
||||
'attribute' => 'Пользователь',
|
||||
'value' => ArrayHelper::getValue($model,'user.username'),
|
||||
'attribute' => 'user_id',
|
||||
'value' => ArrayHelper::getValue($model, 'user.username'),
|
||||
],
|
||||
[
|
||||
'attribute' => 'Вопрос',
|
||||
'value' => ArrayHelper::getValue($model,'question.question_body'),
|
||||
'attribute' => 'question_id',
|
||||
'value' => ArrayHelper::getValue($model, 'question.question_body'),
|
||||
],
|
||||
'response_body',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
[
|
||||
'attribute' => 'answer_flag',
|
||||
'format' => 'raw',
|
||||
'value' => AnswerHelper::answerFlagLable($model->answer_flag),
|
||||
'value' => AnswerHelper::answerFlagLabel($model->answer_flag),
|
||||
],
|
||||
'user_questionnaires_uuid',
|
||||
'user_questionnaire_uuid',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
Reference in New Issue
Block a user