Sha256: b144bc9d8b836615b141444ba2ae99580a95448a741c26d7a44f30b0e9318e88

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 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|
  = ff.quiet_input :question_id unless q.pick == "one" # don't repeat question_id if we're on radio buttons
  = ff.quiet_input :id unless q.pick == "one" or r.new_record?
  = ff.quiet_input :response_group, :value => rg 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.quiet_input :answer_id, :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-0.22.0 app/views/partials/_answer.html.haml