<%=
form.translated(
:text_field,
:body,
tabs_id: id,
label: t(".statement"),
disabled: !editable
)
%>
<%=
form.translated(
:editor,
:description,
toolbar: :full,
tabs_id: id,
label: t(".description"),
disabled: !editable
)
%>
<%=
form.check_box(
:mandatory,
disabled: !editable,
label: t("activemodel.attributes.questionnaire_question.mandatory")
)
%>
<%=
form.select(
:question_type,
options_from_collection_for_select(question_types, :first, :last, question.question_type),
{},
disabled: !editable
)
%>
<% if question.persisted? %>
<%= form.hidden_field :id, disabled: !editable %>
<% end %>
<%= form.hidden_field :position, value: question.position || 0, disabled: !editable %>
<%= form.hidden_field :deleted, disabled: !editable %>
<% question.matrix_rows.each do |matrix_row| %>
<%= fields_for "questionnaire[questions][#{question.to_param}][matrix_rows][]", matrix_row do |matrix_row_form| %>
<%= render "decidim/forms/admin/questionnaires/matrix_row", form: matrix_row_form, question: question, editable: editable %>
<% end %>
<% end %>
<% if editable %>
<% end %>
<% question.answer_options.each do |answer_option| %>
<%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", answer_option do |answer_option_form| %>
<%= render "decidim/forms/admin/questionnaires/answer_option", form: answer_option_form, question: question, editable: editable %>
<% end %>
<% end %>
<% if editable %>
<% end %>
<%=
form.select(
:max_choices,
(2..question.number_of_options),
{ include_blank: t(".any") },
disabled: !editable
)
%>