diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 846ada0c..fadac594 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -70,9 +70,22 @@ var showHideTargetId = function(el, id, related_id) { $('#' + related_id).show(); } - if (id === "#annual_gross_income") { - reveal($("input[name=agree_to_child_support_amount]:checked")); - } + var revealCheckboxes = [ + { + matchIdSelector: "#annual_gross_income", + radioSelector: "input[name=agree_to_child_support_amount]:checked" + }, + { + matchIdSelector: "#spouse_annual_gross_income", + radioSelector: "input[name=spouse_agree_to_child_support_amount]:checked" + } + ]; + + revealCheckboxes.forEach(function(option) { + if (id === option.matchIdSelector) { + reveal($(option.radioSelector)); + } + }); } }; diff --git a/edivorce/apps/core/templates/question/06_children_income_expenses.html b/edivorce/apps/core/templates/question/06_children_income_expenses.html index 64ce1d5d..54dbd753 100644 --- a/edivorce/apps/core/templates/question/06_children_income_expenses.html +++ b/edivorce/apps/core/templates/question/06_children_income_expenses.html @@ -39,7 +39,7 @@ ?
- {% money_input_field name="annual_gross_income" value="" class="money" data_target_id="annual_gross_income" data_related_id="fact_sheet_f" data_reveal_target="true" data_reveal_condition=">150000" %} + {% money_input_field name="annual_gross_income" value="" class="money" data_target_id="annual_gross_income" data_related_id="you_fact_sheet_f" data_reveal_target="true" data_reveal_condition=">150000" %}
- {% endblock %} diff --git a/edivorce/apps/core/utils/question_step_mapping.py b/edivorce/apps/core/utils/question_step_mapping.py index d1f6c58f..fa181e25 100644 --- a/edivorce/apps/core/utils/question_step_mapping.py +++ b/edivorce/apps/core/utils/question_step_mapping.py @@ -39,6 +39,24 @@ question_step_mapping = { 'order_respecting_arrangement', 'order_for_child_support', 'child_support_act', + 'annual_gross_income', + 'number_children_seeking_support', + 'child_support_amount_under_high_income', + 'percent_income_over_high_income_limit', + 'amount_income_over_high_income_limit', + 'total_guideline_amount', + 'agree_to_child_support_amount', + 'agreed_child_support_amount', + 'reason_child_support_amount', + 'spouse_annual_gross_income', + 'spouse_number_children_seeking_support', + 'spouse_child_support_amount_under_high_income', + 'spouse_percent_income_over_high_income_limit', + 'spouse_amount_income_over_high_income_limit', + 'spouse_total_guideline_amount', + 'spouse_agree_to_child_support_amount', + 'spouse_agreed_child_support_amount', + 'spouse_reason_child_support_amount' ], 'spousal_support': ['spouse_support_details', 'spouse_support_act'], 'property_and_debt': ['deal_with_property_debt', diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index 58352fe4..3c8a738f 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -962,5 +962,112 @@ }, "model": "core.question", "pk": "reason_child_support_amount" +}, +{ + "fields": { + "name": "What is your spouse's annual gross income as per the Federal Child Support Guidelines?", + "description": "For Step 6, Your children - Income & expenses", + "summary_order": 0, + "required": "Required" + }, + "model": "core.question", + "pk": "spouse_annual_gross_income" +}, +{ + "fields": { + "name": "How many child(ren) are you asking for support?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_number_children_seeking_support" +}, +{ + "fields": { + "name": "What is the Child Support Guidelines amount for $150,000?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_child_support_amount_under_high_income" +}, +{ + "fields": { + "name": "What is the % of income over $150,000 from the Child Support Guidlines?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_percent_income_over_high_income_limit" +}, +{ + "fields": { + "name": "What is the child support amount to be paid on the portion of income over $150,000?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_amount_income_over_high_income_limit" +}, +{ + "fields": { + "name": "Guidelines table amount", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_total_guideline_amount" +}, +{ + "fields": { + "name": "What is the amount that you and your spouse have agreed to?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "spouse_agree_to_child_support_amount" +}, +{ + "fields": { + "name": "What is the amount that you and your spouse have agreed to?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_agree_to_child_support_amount", + "reveal_response": "NO" + }, + "model": "core.question", + "pk": "spouse_agreed_child_support_amount" +}, +{ + "fields": { + "name": "Why do you think the court should approve your proposed amount?", + "description": "Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "spouse_agree_to_child_support_amount", + "reveal_response": "NO" + }, + "model": "core.question", + "pk": "spouse_reason_child_support_amount" } + ]