<% question = form.object %> <% is_expanded = question.errors.any? %>

<% if editable %> <%== icon("move") %> <% end %> <%= dynamic_title(translated_attribute(question.body), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t(".question")) %> <% if editable %> <% end %>

" data-toggler=".hide" id="<%= id %>-question-card">
<%= 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.number_field( :max_characters, disabled: !editable, min: 0, label: t("activemodel.attributes.questionnaire_question.max_characters") ) %>
<%= 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 ) %>
<% question.display_conditions.each do |display_condition| %> <%= fields_for "questionnaire[questions][#{question.to_param}][display_conditions][]", display_condition do |display_condition_form| %> <%= render "decidim/forms/admin/questionnaires/display_condition", form: display_condition_form, question: question, editable: editable %> <% end %> <% end %>
<% if editable %> <% disabled = !question.persisted? %> <% end %>