4 changed files with 42 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||||||
|
class Form::Sales::Pages::BuildingHeightClass < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@id = "building_height_class" |
||||||
|
@depends_on = [ |
||||||
|
{ "proptype" => 1 }, |
||||||
|
{ "proptype" => 2 }, |
||||||
|
{ "proptype" => 9 }, |
||||||
|
] |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::BuildingHeightClass.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
class Form::Sales::Questions::BuildingHeightClass < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "buildheightclass" |
||||||
|
@type = "radio" |
||||||
|
@answer_options = ANSWER_OPTIONS |
||||||
|
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||||
|
end |
||||||
|
|
||||||
|
ANSWER_OPTIONS = { |
||||||
|
"1" => { "value" => "High-rise" }, |
||||||
|
"2" => { "value" => "Low-rise" }, |
||||||
|
"3" => { "value" => "Don't know" }, |
||||||
|
}.freeze |
||||||
|
|
||||||
|
QUESTION_NUMBER_FROM_YEAR = { 2026 => 17 }.freeze |
||||||
|
end |
||||||
Loading…
Reference in new issue