Sha256: 19e20332001350bbfe688d3fe74310f46e6b1fed7449b2f76ca8f09718e1114d

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

-# TODO: disabled
- rg ||= nil
- r = response_for(@response_set, q, a, rg)
- i = response_idx(q.pick != "one") # argument will be false (don't increment i) if we're on radio buttons
- disabled = defined?(disableFlag) ? disableFlag : false
= f.semantic_fields_for i, r do |ff|
  %span.help= render_help_text(a, @render_context) unless g && g.display_type == "grid"
  = ff.input :question_id, :as => :quiet unless q.pick == "one" # don't repeat question_id if we're on radio buttons
  = ff.input :api_id, :as => :quiet unless q.pick == "one"
  = ff.input :response_group, :value => rg, :as => :quiet if q.pick != "one" && g && g.display_type == "repeater"
  - case q.pick
  - when "one"
    = ff.input :answer_id, :as => :surveyor_radio, :collection => [[a_text(a, nil, @render_context), a.id]], :label => false, :input_html => {:class => a.css_class, :disabled => disabled}, :response_class => a.response_class
  - when "any"
    = ff.input :answer_id, :as => :surveyor_check_boxes, :collection => [[a_text(a, nil, @render_context), a.id]], :label => false, :input_html => {:class => a.css_class, :disabled => disabled}, :response_class => a.response_class
  - when "none"
    - if %w(date datetime time float integer string text).include? a.response_class
      = ff.input :answer_id, :as => :quiet, :input_html => {:class => a.css_class, :value => a.id}
      = ff.input rc_to_attr(a.response_class), :as => rc_to_as(a.response_class), :label => a_text(a, :pre, @render_context).blank? ? false : a_text(a, :pre, @render_context), :hint => a_text(a, :post, @render_context), :input_html => generate_pick_none_input_html(r.as(a.response_class), a.default_value, a.css_class, a.response_class, disabled)
    - else
      = a_text(a, nil, @render_context)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
surveyor-1.2.0 app/views/partials/_answer.html.haml