Browse Source

DIV-963: Updated order pertaining children logic to update value of child support question.

pull/160/head
Charles Shin 6 years ago
parent
commit
5a3791a89e
3 changed files with 48 additions and 15 deletions
  1. +13
    -0
      edivorce/apps/core/static/js/main.js
  2. +1
    -1
      edivorce/apps/core/templates/question/01_orders.html
  3. +34
    -14
      edivorce/apps/core/templates/question/06_children_what_for.html

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

@ -688,6 +688,19 @@ $(function () {
}
});
// If Orders pertaining to children is not selected from want which order page,
// update the value of child_support_in_order on Step 6: What are you asking for
// to "NO"
$('#order_child_support').on('change', function() {
var orderChildSupport = $(this).prop('checked');
if (!orderChildSupport) {
var question = 'child_support_in_order';
var value = 'NO';
ajaxCall(question, value);
}
});
$('#check_order_selected').on('click', function (e) {
var showAlert = $(this).data('show_alert');
var childSupport = $('input[data-target_id=child_support_alert]').prop('checked');


+ 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" class="show-order-alert-input" data_target_id="child_support_alert" data_invert_target=".orders-alert-child-support" data_reveal_target="true" %}
{% input_field type="checkbox" name="want_which_orders" value="Child support" id="order_child_support" class="show-order-alert-input" data_target_id="child_support_alert" data_invert_target=".orders-alert-child-support" data_reveal_target="true" %}
Orders pertaining to children
</label>
</div>


+ 34
- 14
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -28,7 +28,11 @@
</h3>
<div class="radio">
<label class="radio-with-textbox">
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" %}
{% if 'Child support' in want_which_orders|load_json %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" %}
{% else %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" disabled="" %}
{% endif %}
{% comment "Child support guideline value scenarios" %}
If split or shared custody, prepopulate the field with the value from factsheet.
@ -50,28 +54,44 @@
</div>
<div class="radio">
<label class="radio-with-textbox">
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" %}
{% if 'Child support' in want_which_orders|load_json %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" %}
{% else %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" disabled="" %}
{% endif %}
{% if child_support_in_order == 'DIFF' %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %}
</div>
{% elif agree_to_guideline_child_support_amount == 'NO' %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" value_src="appropriate_spouse_paid_child_support" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %}
</div>
{% if 'Child support' in want_which_orders|load_json %}
{% if child_support_in_order == 'DIFF' %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %}
</div>
{% elif agree_to_guideline_child_support_amount == 'NO' %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" value_src="appropriate_spouse_paid_child_support" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %}
</div>
{% else %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" value='0' %}
</div>
{% endif %}
{% else %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" value='0' %}
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" value='0' readonly="" %}
</div>
{% endif %}
Different amount (does not match Child Support Guidelines)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}We are not asking for child support to be included in the order
</label>
{% if 'Child support' in want_which_orders|load_json %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}We are not asking for child support to be included in the order</label>
{% else %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" disabled="" checked="" %}We are not asking for child support to be included in the order</label>
<div class="information-message bg-danger">
<p>This option has been automatically selected for you because you indicated in Step 1 you didn't want an "Order pertaining to children"</p>
</div>
{% endif %}
<p id="child_support_in_order_detail">
Please describe what arrangements have been made for the support of the child (ren)?
{% input_field type="textarea" name="child_support_in_order_reason" class="other-textbox response-textarea form-control" tabindex="-1" maxlength="500" rows="3" %}


Loading…
Cancel
Save