<% unless current_participatory_space.can_participate?(current_user) %>
<% end %>
<%= decidim_form_for(@form, url: update_url, method: :post, html: { multipart: true, class: "form answer-questionnaire" }, data: { "safe-path" => form_path }) do |form| %>
<%= form_required_explanation %>
<%= invisible_captcha %>
<% answer_idx = 0 %>
<% cleaned_answer_idx = 0 %>
<% @form.responses_by_step.each_with_index do |step_answers, step_index| %>
" data-toggler=".hide">
<% if @form.total_steps > 1 %>
<%= t(".current_step", step: step_index + 1) %>
<%= t(".of_total_steps", total_steps: @form.total_steps) %>
<% end %>
<% step_answers.each do |answer| %>
<% answer.question.display_conditions.each do |display_condition| %>
<%= content_tag :div, nil, class: "display-condition", data: display_condition.to_html_data %>
<% end %>
<%= fields_for "questionnaire[responses][#{answer_idx}]", answer do |answer_form| %>
<%= render(
"decidim/forms/questionnaires/answer",
answer_form: answer_form,
answer: answer,
answer_idx: answer_idx,
cleaned_answer_idx: cleaned_answer_idx,
disabled: !current_participatory_space.can_participate?(current_user)
) %>
<% end %>
<% if !(answer.question.separator? || answer.question.title_and_description?) %>
<% cleaned_answer_idx += 1 %>
<% end %>
<% answer_idx += 1 %>
<% end %>
<% if step_index + 1 == @form.total_steps %>
<% if show_represent_user_group? %>
<%= cell("decidim/represent_user_group", form) %>
<% end %>
<% if show_public_participation? %>
<%= cell("decidim/public_participation", form) %>
<% end %>
<%= form.check_box :tos_agreement, label: t(".tos_agreement"), id: "questionnaire_tos_agreement", disabled: !current_participatory_space.can_participate?(current_user) %>
<%= decidim_sanitize_editor translated_attribute questionnaire.tos %>
<% end %>
<%= cell(
"decidim/forms/step_navigation",
step_index,
total_steps: @form.total_steps,
button_disabled: !current_participatory_space.can_participate?(current_user),
form: form
) %>