Sha256: b65b28b6d11f8d6f34d87bc1274b6643c88885403913ba1f14040c26450c59b6

Contents?: true

Size: 1.33 KB

Versions: 8

Compression:

Stored size: 1.33 KB

Contents

<% field_id = "questionnaire_responses_#{answer_idx}" %>

<% if answer.question.separator? %>
  <%= render partial: "decidim/forms/questionnaires/answers/#{answer.question.question_type}", locals: { answer: answer, answer_form: answer_form, answer_idx: answer_idx, field_id: field_id, disabled: disabled } %>
  <%= answer_form.hidden_field :question_id %>
<% else %>
  <% case answer.question.question_type %>
  <% when "single_option", "multiple_option", "sorting" %>
    <label class="questionnaire-question"><%= answer.label(cleaned_answer_idx) %></label>
  <% else %>
    <%= label_tag field_id, answer.label(cleaned_answer_idx), class: "questionnaire-question" %>
  <% end %>

  <% if translated_attribute(answer.question.description).present? %>
    <div class="help-text">
      <%= decidim_sanitize translated_attribute(answer.question.description) %>
    </div>
  <% end %>

  <%= render partial: "decidim/forms/questionnaires/answers/#{answer.question.question_type}", locals: { answer: answer, answer_form: answer_form, answer_idx: answer_idx, field_id: field_id, disabled: disabled } %>

  <%= answer_form.hidden_field :question_id %>

  <small class="form-error max-choices-alert"><%= t(".max_choices_alert") %></small>

  <% answer.errors.full_messages.each do |msg| %>
    <small class="form-error is-visible"><%= msg %></small>
  <% end %>
<% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-forms-0.23.6 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.5 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.4 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.3 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.2 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.1 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.1.rc1 app/views/decidim/forms/questionnaires/_answer.html.erb
decidim-forms-0.23.0 app/views/decidim/forms/questionnaires/_answer.html.erb