Sha256: 3e029f94f82c113cfe1a48fc87756d729e7345010c015ebdf9078fa0f8fc3fe3

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

- label_width = "#{60 / question.labels.count}%"

.radio_matrix.form-group{ class: "#{'has-error' if errors.present?}" }
  %label{class: "#{'text-danger' if errors.present?}"}
    != question.question_text
    = ' *' if question.required
  .table-responsive
    %table.table
      %thead
        %tr
          %th
          - question.labels.each do |label|
            %th{ width: label_width }
              = label.text
          %th

      %tbody
        - question.sub_questions.each do |sub_question|
          %tr
            %td.text-right
              = sub_question.parts.first
              - if errors[sub_question.code]
                .help-block.text-danger= errors[sub_question.code]
            - question.labels.each do |label|
              - checked = answers[sub_question.code].to_s == label.value.to_s if answers[sub_question.code].present?
              - checked ||= (label.preselected? ? true : false)
              %td{ width: label_width }
                %label
                  = form.simple_fields_for :answers do |answer_form|
                    = answer_form.radio_button sub_question.code, label.value, checked: checked
                  %span.hide-text= label.text
            %td
              = sub_question.parts.last if sub_question.splitted?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
helena-1.0.0.rc2 app/views/helena/questions/_bipolar_radio_matrix.html.haml