feat: calmer questionnaire form with selects and clickable answer rows
This commit is contained in:
1 parent
af97468b2d
commit
0b736b51fb
5 files changed
+65
-5
No files matched your search
@@ -151,14 +151,20 @@ class QuestionnaireType extends AbstractType
|
||||
return match ($question->type) {
|
||||
QuestionType::TEXT => [TextType::class, $common],
|
||||
QuestionType::TEXTAREA => [AutosizeTextareaType::class, $common + ['min_rows' => 3]],
|
||||
QuestionType::CHOICE => [ChoiceType::class, $common + $this->choices($question) + [
|
||||
'expanded' => ChoiceWidget::RADIO === $question->widget,
|
||||
// a radio list needs no "none" entry, a select needs an empty first line
|
||||
'placeholder' => ChoiceWidget::RADIO === $question->widget ? false : 'Bitte wählen',
|
||||
]],
|
||||
QuestionType::CHOICE => [ChoiceType::class, $common + $this->choices($question) + (ChoiceWidget::RADIO === $question->widget ? [
|
||||
'expanded' => true,
|
||||
// a radio list needs no "none" entry
|
||||
'placeholder' => false,
|
||||
'block_prefix' => 'questionnaire_choice',
|
||||
] : [
|
||||
'expanded' => false,
|
||||
// a select needs an empty first line, or the first option would be preselected
|
||||
'placeholder' => 'Bitte wählen',
|
||||
])],
|
||||
QuestionType::MULTI => [ChoiceType::class, $common + $this->choices($question) + [
|
||||
'expanded' => true,
|
||||
'multiple' => true,
|
||||
'block_prefix' => 'questionnaire_choice',
|
||||
]],
|
||||
QuestionType::DATE => [DatepickerType::class, $common + [
|
||||
'input' => 'string',
|
||||
|
||||
Reference in new issue
Block a user