Sha256: b6ef059cff2ef147edd9d20eeb65ceab1c25f61e82557669ad3de6d6fedc8a75

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 KB

Contents

<div class="answer-questionnaire__single-option js-radio-button-collection">
  <% choice = answer.choices.first %>

  <% answer.question.answer_options.each_with_index do |answer_option, idx| %>
    <% choice_id = "#{field_id}_choices_#{idx}" %>

    <div class="js-collection-input">
      <%= label_tag "#{choice_id}_body" do %>
        <%= radio_button_tag "questionnaire[responses][#{answer_idx}][choices][][body]",
                             translated_attribute(answer_option.body),
                             answer_option.id == choice.try(:answer_option_id),
                             id: "#{choice_id}_body", disabled: %>

        <%= translated_attribute(answer_option.body) %>

        <%= hidden_field_tag "questionnaire[responses][#{answer_idx}][choices][][answer_option_id]",
                             answer_option.id,
                             id: "#{choice_id}_answer_option",
                             disabled: true %>
      <% end %>

      <% if answer_option.free_text %>
        <%= text_field_tag "questionnaire[responses][#{answer_idx}][choices][][custom_body]",
                           choice.try(:custom_body),
                           id: "#{choice_id}_custom_body",
                           disabled: true,
                           maxlength:,
                           class: "w-full" %>
      <% end %>
    </div>
  <% end %>
</div>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-forms-0.29.1 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.4 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.29.0 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.3 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.29.0.rc4 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.29.0.rc3 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.29.0.rc2 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.29.0.rc1 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.2 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.1 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.0 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.0.rc5 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
decidim-forms-0.28.0.rc4 app/views/decidim/forms/questionnaires/answers/_single_option.html.erb