Browse Source

DIV-1131: Update requirement for children_live_with_others

pull/170/head
ariannedee 5 years ago
parent
commit
8fc3f05006
5 changed files with 32 additions and 14 deletions
  1. +0
    -6
      edivorce/apps/core/static/js/functions.js
  2. +15
    -0
      edivorce/apps/core/static/js/main.js
  3. +7
    -7
      edivorce/apps/core/templates/prequalification/step_04.html
  4. +7
    -0
      edivorce/apps/core/utils/conditional_logic.py
  5. +3
    -1
      edivorce/fixtures/Question.json

+ 0
- 6
edivorce/apps/core/static/js/functions.js View File

@ -144,12 +144,6 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) {
$(el.data("reveal_force_hide_group")).hide();
$(el.data("reveal_force_hide_group")).find(':radio').prop('checked', false);
}
// Special case of pre-qualification step 4 children.
if (id === "#has_children") {
if (el.val() === 'NO') {
$('.not-disqualified-other').show();
}
}
// Special case of show child support description.
if (id === "#child_support_in_order_detail") {


+ 15
- 0
edivorce/apps/core/static/js/main.js View File

@ -744,6 +744,21 @@ $(function () {
}
});
// For Prequalification step 4
// If they have children under 19 or are financially supporting children over 19, show question children_live_with_others
var showHideChildrenLiveWithOthers = function() {
var childrenUnder19 = $('input[name="has_children_under_19"][value="YES"]').prop('checked');
var childrenOver19 = $('input[name="has_children_over_19"][value="YES"]').prop('checked');
var notSupportingOver19 = $('input#no_children_financial_support').prop('checked');
if (childrenUnder19 || (childrenOver19 && !notSupportingOver19)) {
$('#children_live_with_others').show();
} else {
$('#children_live_with_others').hide();
}
}
showHideChildrenLiveWithOthers();
$('input[name="has_children_under_19"], input[name="has_children_over_19"], input[name="children_financial_support"]').change(showHideChildrenLiveWithOthers);
$('.money').on('change', function() {
var value = parseFloat($(this).val());


+ 7
- 7
edivorce/apps/core/templates/prequalification/step_04.html View File

@ -155,12 +155,12 @@
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="has_children_over_19" autocomplete="off" value="YES" data_target_id="financial_support" data_reveal_class="true" data_target_class="not-disqualified-age" data_reveal_target="true" %}
{% input_field type="radio" name="has_children_over_19" autocomplete="off" value="YES" data_target_id="financial_support" data_reveal_target="true" %}
Yes
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="has_children_over_19" autocomplete="off" value="NO" data_target_id="financial_support" data_reveal_class="true" data_target_class="not-disqualified-age" data_reveal_target="false" %}
{% input_field type="radio" name="has_children_over_19" autocomplete="off" value="NO" data_target_id="financial_support" data_reveal_target="false" %}
No
</label>
</div>
@ -171,11 +171,11 @@
years or older?</h3>
<p>Please check all that apply.</p>
<div class="checkbox-group">
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="NO" data_checkbox_radio="true" data_checkbox_radio_state_set="false" data_target_id="children_live_with_others" data_reveal_target="false" data_target_class="not-disqualified-other" data_reveal_class="true" %}No</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, attending post secondary institution" data_checkbox_radio="true" data_checkbox_radio_state_set="true" data_target_id="children_live_with_others" data_reveal_target="true" %}Yes, attending post secondary institution</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, due to disability" data_checkbox_radio="true" data_checkbox_radio_state_set="true" data_target_id="children_live_with_others" data_reveal_target="true" %}Yes, due to disability</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, due to illness" data_checkbox_radio="true" data_checkbox_radio_state_set="true" data_target_id="children_live_with_others" data_reveal_target="true" %}Yes, due to illness</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, other reason" data_checkbox_radio="true" data_checkbox_radio_state_set="true" data_target_id="children_live_with_others" data_reveal_target="true" %}Yes, other reason(s)</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="NO" id="no_children_financial_support" data_checkbox_radio="true" data_checkbox_radio_state_set="false" %}No</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, attending post secondary institution" data_checkbox_radio="true" data_checkbox_radio_state_set="true" %}Yes, attending post secondary institution</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, due to disability" data_checkbox_radio="true" data_checkbox_radio_state_set="true" %}Yes, due to disability</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, due to illness" data_checkbox_radio="true" data_checkbox_radio_state_set="true" %}Yes, due to illness</label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="children_financial_support" value="Yes, other reason" data_checkbox_radio="true" data_checkbox_radio_state_set="true" %}Yes, other reason(s)</label></div>
</div>
<div class="collapse-trigger collapsed" data-toggle="collapse"
aria-expanded="false" data-target="#collapse_circumstances_change_child_support"


+ 7
- 0
edivorce/apps/core/utils/conditional_logic.py View File

@ -131,6 +131,13 @@ def determine_missing_extraordinary_expenses(questions_dict):
return False
def determine_show_children_live_with_others(questions_dict):
has_children_of_marriage = questions_dict.get('children_of_marriage', '') == 'YES'
has_children_under_19 = questions_dict.get('has_children_under_19', '') == 'YES'
child_over_19_supported = determine_child_over_19_supported(questions_dict)
return has_children_of_marriage and (has_children_under_19 or child_over_19_supported)
def get_cleaned_response_value(response):
if response is None:
return None


+ 3
- 1
edivorce/fixtures/Question.json View File

@ -112,7 +112,9 @@
"name": "Do any of the your children live with someone who is not you or your spouse?",
"description": "For pre-qualification step 4, determines eligibility of using the app",
"summary_order": 11,
"required": ""
"required": "Conditional",
"conditional_target": "determine_show_children_live_with_others",
"reveal_response": "True"
},
"model": "core.question",
"pk": "children_live_with_others"


Loading…
Cancel
Save