Matthew Phelan
3 years ago
8 changed files with 192 additions and 1 deletions
@ -0,0 +1,26 @@
|
||||
<% economic_statuses = [ |
||||
OpenStruct.new(id: 0, ethnicity: "Part-time - Less than 30 hours"), |
||||
OpenStruct.new(id: 1, ethnicity: "Full-time - 30 hours or more"), |
||||
OpenStruct.new(id: 2, ethnicity: "In government training into work, such as New Deal"), |
||||
OpenStruct.new(id: 3, ethnicity: "Jobseeker"), |
||||
OpenStruct.new(id: 4, ethnicity: "Retired"), |
||||
OpenStruct.new(id: 5, ethnicity: "Not seeking work"), |
||||
OpenStruct.new(id: 6, ethnicity: "Full-time student"), |
||||
OpenStruct.new(id: 7, ethnicity: "Unable to work because of long term sick or disability"), |
||||
OpenStruct.new(id: 8, ethnicity: "Child under 16"), |
||||
OpenStruct.new(id: 9, ethnicity: "Other"), |
||||
OpenStruct.new(id: 10, ethnicity: "Prefer not to say") |
||||
] %> |
||||
|
||||
<% previous_question = Form.previous_question("economic_status") %> |
||||
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> |
||||
Back |
||||
<% end %> |
||||
<%= turbo_frame_tag "case_log_form", target: "_top" do %> |
||||
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_collection_radio_buttons :economic_status, economic_statuses, :id, :ethnicity, legend: { text: "Which of these best describes the tenant's working situation?", size: "l" } %> |
||||
<%= f.hidden_field :previous_question, value: :economic_status %> |
||||
<%= f.hidden_field :case_log_id, value: case_log_id %> |
||||
<%= f.govuk_submit "Save and continue" %> |
||||
<% end %> |
||||
<% end %> |
@ -0,0 +1,17 @@
|
||||
<% previous_question = Form.previous_question("other_household_members") %> |
||||
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> |
||||
Back |
||||
<% end %> |
||||
|
||||
<%= turbo_frame_tag "case_log_form", target: "_top" do %> |
||||
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_number_field :other_household_members, |
||||
hint: { text: "The maximum number of others is 7" }, |
||||
label: { text: "How many other people are there in the household?", size: "l"}, |
||||
min: 0, max: 7, step: 1, width: 20 |
||||
%> |
||||
<%= f.hidden_field :previous_question, value: :other_household_members %> |
||||
<%= f.hidden_field :case_log_id, value: case_log_id %> |
||||
<%= f.govuk_submit "Save and continue" %> |
||||
<% end %> |
||||
<% end %> |
@ -0,0 +1,35 @@
|
||||
<% ethnic_groups = [ |
||||
OpenStruct.new(id: 0, ethnicity: "White: English/Scottish/Welsh/Northern Irish/British"), |
||||
OpenStruct.new(id: 1, ethnicity: "White: Irish"), |
||||
OpenStruct.new(id: 2, ethnicity: "White: Gypsy/Irish Traveller"), |
||||
OpenStruct.new(id: 3, ethnicity: "White: Other"), |
||||
OpenStruct.new(id: 4, ethnicity: "Mixed: White & Black Caribbean"), |
||||
OpenStruct.new(id: 5, ethnicity: "Mixed: White & Black African"), |
||||
OpenStruct.new(id: 6, ethnicity: "Mixed: White & Asian"), |
||||
OpenStruct.new(id: 7, ethnicity: "Mixed: Other"), |
||||
OpenStruct.new(id: 8, ethnicity: "Asian or Asian British: Indian"), |
||||
OpenStruct.new(id: 9, ethnicity: "Asian or Asian British: Pakistani"), |
||||
OpenStruct.new(id: 10, ethnicity: "Asian or Asian British: Bangladeshi"), |
||||
OpenStruct.new(id: 11, ethnicity: "Asian or Asian British: Chinese"), |
||||
OpenStruct.new(id: 12, ethnicity: "Asian or Asian British: Other"), |
||||
OpenStruct.new(id: 13, ethnicity: "Black: Caribbean"), |
||||
OpenStruct.new(id: 14, ethnicity: "Black: African"), |
||||
OpenStruct.new(id: 15, ethnicity: "Black: Other"), |
||||
OpenStruct.new(id: 16, ethnicity: "Other Ethnic Group: Arab"), |
||||
OpenStruct.new(id: 17, ethnicity: "Other Ethnic Group: Other"), |
||||
OpenStruct.new(id: 18, ethnicity: "Prefer not to say") |
||||
] %> |
||||
|
||||
<% previous_question = Form.previous_question("tenant_ethnic_group") %> |
||||
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> |
||||
Back |
||||
<% end %> |
||||
|
||||
<%= turbo_frame_tag "case_log_form", target: "_top" do %> |
||||
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_collection_radio_buttons :tenant_ethnic_group, ethnic_groups, :id, :ethnicity, legend: { text: "What is the tenant’s ethnic group?", size: "l" } %> |
||||
<%= f.hidden_field :previous_question, value: :tenant_ethnic_group %> |
||||
<%= f.hidden_field :case_log_id, value: case_log_id %> |
||||
<%= f.govuk_submit "Save and continue" %> |
||||
<% end %> |
||||
<% end %> |
@ -0,0 +1,32 @@
|
||||
<% nationalities = [ |
||||
OpenStruct.new(id: 0, ethnicity: "UK national resident in UK"), |
||||
OpenStruct.new(id: 1, ethnicity: "A current or former reserve in the UK Armed Forces (exc. National Service)"), |
||||
OpenStruct.new(id: 2, ethnicity: "UK national returning from residence overseas"), |
||||
OpenStruct.new(id: 3, ethnicity: "Czech Republic"), |
||||
OpenStruct.new(id: 4, ethnicity: "Estonia"), |
||||
OpenStruct.new(id: 5, ethnicity: "Hungary"), |
||||
OpenStruct.new(id: 6, ethnicity: "Latvia"), |
||||
OpenStruct.new(id: 7, ethnicity: "Lithuania"), |
||||
OpenStruct.new(id: 8, ethnicity: "Poland"), |
||||
OpenStruct.new(id: 9, ethnicity: "Slovakia"), |
||||
OpenStruct.new(id: 10, ethnicity: "Bulgaria"), |
||||
OpenStruct.new(id: 11, ethnicity: "Romania"), |
||||
OpenStruct.new(id: 12, ethnicity: "Ireland"), |
||||
OpenStruct.new(id: 13, ethnicity: "Other EU Economic Area (EEA country)"), |
||||
OpenStruct.new(id: 14, ethnicity: "Any other country"), |
||||
OpenStruct.new(id: 15, ethnicity: "Prefer not to say") |
||||
] %> |
||||
|
||||
<% previous_question = Form.previous_question("tenant_nationality") %> |
||||
<%= govuk_back_link href: "/case_logs/#{case_log_id}/#{previous_question}" do %> |
||||
Back |
||||
<% end %> |
||||
|
||||
<%= turbo_frame_tag "case_log_form", target: "_top" do %> |
||||
<%= form_with action: '/case_logs', method: "next_question", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_collection_radio_buttons :tenant_nationality, nationalities, :id, :ethnicity, legend: { text: "What is the tenant’s ethnic group?", size: "l" } %> |
||||
<%= f.hidden_field :previous_question, value: :tenant_nationality %> |
||||
<%= f.hidden_field :case_log_id, value: case_log_id %> |
||||
<%= f.govuk_submit "Save and continue" %> |
||||
<% end %> |
||||
<% end %> |
@ -0,0 +1,36 @@
|
||||
class AddHouseholdCharacteristicsToCaseLogs < ActiveRecord::Migration[6.1] |
||||
def change |
||||
change_table :case_logs, bulk: true do |t| |
||||
t.column :economic_status, :string |
||||
t.column :number_of_other_members, :integer |
||||
t.column :person_2_relationship, :string |
||||
t.column :person_2_age, :integer |
||||
t.column :person_2_gender, :string |
||||
t.column :person_2_economic, :string |
||||
t.column :person_3_relationship, :string |
||||
t.column :person_3_age, :integer |
||||
t.column :person_3_gender, :string |
||||
t.column :person_3_economic, :string |
||||
t.column :person_4_relationship, :string |
||||
t.column :person_4_age, :integer |
||||
t.column :person_4_gender, :string |
||||
t.column :person_4_economic, :string |
||||
t.column :person_5_relationship, :string |
||||
t.column :person_5_age, :integer |
||||
t.column :person_5_gender, :string |
||||
t.column :person_5_economic, :string |
||||
t.column :person_6_relationship, :string |
||||
t.column :person_6_age, :integer |
||||
t.column :person_6_gender, :string |
||||
t.column :person_6_economic, :string |
||||
t.column :person_7_relationship, :string |
||||
t.column :person_7_age, :integer |
||||
t.column :person_7_gender, :string |
||||
t.column :person_7_economic, :string |
||||
t.column :person_8_relationship, :string |
||||
t.column :person_8_age, :integer |
||||
t.column :person_8_gender, :string |
||||
t.column :person_8_economic, :string |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue