Browse Source

DIV-971: Added additional prequal question for children.

pull/160/head
Charles Shin 5 years ago
parent
commit
f5232f7313
6 changed files with 61 additions and 9 deletions
  1. +12
    -0
      edivorce/apps/core/static/js/functions.js
  2. +29
    -5
      edivorce/apps/core/templates/prequalification/step_04.html
  3. +1
    -1
      edivorce/apps/core/templates/question/01_orders.html
  4. +5
    -1
      edivorce/apps/core/templatetags/summary_format.py
  5. +3
    -1
      edivorce/apps/core/utils/question_step_mapping.py
  6. +11
    -1
      edivorce/fixtures/Question.json

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

@ -117,8 +117,14 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) {
if (relatedId !== undefined) {
$('#' + relatedId).hide();
}
// Special case of pre-qualification step 4 children.
if (id === "#has_children") {
reveal($("input[name=number_children_over_19]"));
var over_19_children = parseInt($("input[name=number_children_over_19]").val());
if (over_19_children >= 0) {
reveal($("input[name=number_children_over_19]:checked"));
}
}
// Special case of hide child support description.
if (id === "#child_support_in_order_detail") {
@ -147,6 +153,12 @@ 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") {


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

@ -143,11 +143,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="need_support" 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" %}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 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>
<div class="collapse-trigger collapsed" data-toggle="collapse"
aria-expanded="false" data-target="#collapse_circumstances_change_child_support"
@ -207,6 +207,30 @@
</p>
</div>
</div>
<div class="reveal question-well" id="children_live_with_others">
<h3>Do any of the your children live with someone who is not you or your spouse?</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="children_live_with_others" autocomplete="off" value="YES" data_target_id="children_live_with_others_stop" data_reveal_target="true" data_target_class="not-disqualified-other" data_reveal_class="false" %} Yes
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="children_live_with_others" autocomplete="off" value="NO" data_target_id="children_live_with_others_stop" data_reveal_target="false" data_target_class="not-disqualified-other" data_reveal_class="true" %} No
</label>
</div>
<p>For example: you should select 'Yes' if your child lives with an Aunt, Uncle or Grandparent.</p>
<div class="information-message bg-danger hard-stop" id="children_live_with_others_stop" hidden>
<p>
This application does not currently support situations where the children do not live with one or both of the spouses. Please click the
<a href="{% url 'legal' %}" target="_blank">'Get Help'</a>
button in the top right of this application to view other resources that can help you.
</p>
</div>
</div>
</div>
{% endblock %}


+ 1
- 1
edivorce/apps/core/templates/question/01_orders.html View File

@ -177,7 +177,7 @@ asked to provide details for each request.</p>
<div class="question-well">
<div class="checkbox">
<label>
{% input_field type="checkbox" name="want_which_orders" value="Child support" id="order_child_support" class="show-order-alert-inputs" %}
{% input_field type="checkbox" name="want_which_orders" value="Child support" id="order_child_support" class="show-order-alert-input" %}
Orders pertaining to children
</label>
</div>


+ 5
- 1
edivorce/apps/core/templatetags/summary_format.py View File

@ -413,7 +413,7 @@ def prequal_tag(source):
marriage_status = lived_in_bc = live_at_least_year = separation_date = try_reconcile = reconciliation_period = None
children_of_marriage = number_children_under_19 = number_children_over_19 = financial_support = certificate = provide_later = None
provide_later_reason = not_provide_later_reason = in_english = divorce_reason = None
provide_later_reason = not_provide_later_reason = in_english = divorce_reason = children_live_with_others = None
for item in source:
q_id = item['question_id']
@ -437,6 +437,8 @@ def prequal_tag(source):
number_children_over_19 = item
elif q_id == 'children_financial_support':
financial_support = item
elif q_id == 'children_live_with_others':
children_live_with_others = item
elif q_id == 'original_marriage_certificate':
certificate = item
elif q_id == 'provide_certificate_later':
@ -472,6 +474,8 @@ def prequal_tag(source):
tags = format_table_data(tags, number_children_over_19['question__name'], number_children_over_19['value'])
if children_of_marriage and children_of_marriage['value'] == 'YES' and number_children_over_19 and financial_support and financial_support['value']:
tags = format_table_data(tags, financial_support['question__name'], '<br>'.join(json.loads(financial_support['value'])))
if children_of_marriage and children_of_marriage['value'] == 'YES' and number_children_over_19 and financial_support:
tags = format_table_data(tags, children_live_with_others['question__name'], children_live_with_others['value'])
if certificate:
tags = format_table_data(tags, certificate['question__name'], certificate['value'])
if certificate and certificate['value'] == 'NO' and provide_later:


+ 3
- 1
edivorce/apps/core/utils/question_step_mapping.py View File

@ -21,7 +21,8 @@ pre_qual_step_question_mapping = {
'children_of_marriage',
'number_children_under_19',
'number_children_over_19',
'children_financial_support'
'children_financial_support',
'children_live_with_others'
},
'05': {
'original_marriage_certificate',
@ -44,6 +45,7 @@ question_step_mapping = {
'number_children_under_19',
'number_children_over_19',
'children_financial_support',
'children_live_with_others',
'original_marriage_certificate',
'provide_certificate_later',
'provide_certificate_later_reason',


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

@ -75,7 +75,7 @@
"fields": {
"name": "Are you financially supporting any of the children that are 19 years or older?",
"description": "For pre-qualification step 4, Form 1 3. Info concerning children",
"summary_order": 9,
"summary_order": 8,
"required": "Conditional",
"conditional_target": "number_children_over_19",
"reveal_response": ">0"
@ -83,6 +83,16 @@
"model": "core.question",
"pk": "children_financial_support"
},
{
"fields": {
"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": 9,
"required": ""
},
"model": "core.question",
"pk": "children_live_with_others"
},
{
"fields": {
"name": "Will you be able to provide proof of your marriage (in the form of an original or certified marriage certificate or registration of marriage)?",


Loading…
Cancel
Save