4 changed files with 56 additions and 0 deletions
@ -0,0 +1,16 @@
|
||||
class Form::Sales::Pages::Buyer2RelationshipToBuyer1 < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "buyer_2_relationship_to_buyer_1" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::Buyer2RelationshipToBuyer1.new(nil, nil, self), |
||||
Form::Sales::Questions::OtherBuyer2RelationshipToBuyer1.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,29 @@
|
||||
class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "relat2" |
||||
@check_answer_label = "Buyer 2's relationship to buyer 1" |
||||
@header = "What is buyer 2's relationship to buyer 1?" |
||||
@type = "radio" |
||||
@hint_text = "" |
||||
@page = page |
||||
@answer_options = ANSWER_OPTIONS |
||||
@conditional_for = { |
||||
"otherrelat2" => ["X"], |
||||
} |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"relat2" => "X", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"P" => { "value" => "Parent" }, |
||||
"C" => { "value" => "Child" }, |
||||
"X" => { "value" => "Other" }, |
||||
"R" => { "value" => "Buyer prefers not to say" }, |
||||
}.freeze |
||||
end |
@ -0,0 +1,10 @@
|
||||
class Form::Sales::Questions::OtherBuyer2RelationshipToBuyer1 < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "otherrelat2" |
||||
@check_answer_label = "Buyer 2's relationship to buyer 1" |
||||
@header = "Buyer 2's relationship to buyer 1" |
||||
@type = "text" |
||||
@page = page |
||||
end |
||||
end |
Loading…
Reference in new issue