natdeanlewissoftwire
2 years ago
10 changed files with 63 additions and 16 deletions
@ -0,0 +1,22 @@ |
|||||||
|
class Form::Sales::Pages::Person1Known < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@id = "person_1_known" |
||||||
|
@header_partial = "person_1_known_page" |
||||||
|
@header = "" |
||||||
|
@description = "" |
||||||
|
@subsection = subsection |
||||||
|
@depends_on = [ |
||||||
|
{ "hholdcount" => 1 }, |
||||||
|
{ "hholdcount" => 2 }, |
||||||
|
{ "hholdcount" => 3 }, |
||||||
|
{ "hholdcount" => 4 }, |
||||||
|
] |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::Person1Known.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,25 @@ |
|||||||
|
class Form::Sales::Questions::Person1Known < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "details_known_1" |
||||||
|
@check_answer_label = "Details known for person 1?" |
||||||
|
@header = "Do you know the details for person 1?" |
||||||
|
@type = "radio" |
||||||
|
@answer_options = ANSWER_OPTIONS |
||||||
|
@page = page |
||||||
|
@hint_text = "" |
||||||
|
@hidden_in_check_answers = { |
||||||
|
"depends_on" => [ |
||||||
|
{ |
||||||
|
"details_known_1" => 1, |
||||||
|
}, |
||||||
|
], |
||||||
|
} |
||||||
|
@check_answers_card_number = 3 |
||||||
|
end |
||||||
|
|
||||||
|
ANSWER_OPTIONS = { |
||||||
|
"1" => { "value" => "Yes" }, |
||||||
|
"2" => { "value" => "No" }, |
||||||
|
}.freeze |
||||||
|
end |
@ -0,0 +1 @@ |
|||||||
|
You have given us the details for 0 of the <%= log.hholdcount %> other people in the household |
@ -0,0 +1,5 @@ |
|||||||
|
class AddDetailsKnown1ToSalesLog < ActiveRecord::Migration[7.0] |
||||||
|
change_table :sales_logs, bulk: true do |t| |
||||||
|
t.column :details_known_1, :integer |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue