Browse Source

DIV-591: Tweaks so that only the error message that corresponds with the specific checkbox is show or not shown at the bottom of the page

pull/160/head
Benard Ebinu 8 years ago
parent
commit
844e64f2b2
4 changed files with 43 additions and 21 deletions
  1. +1
    -1
      edivorce/apps/core/static/css/main.css
  2. +1
    -1
      edivorce/apps/core/static/css/main.scss
  3. +23
    -3
      edivorce/apps/core/static/js/main.js
  4. +18
    -16
      edivorce/apps/core/templates/question/01_orders.html

+ 1
- 1
edivorce/apps/core/static/css/main.css
File diff suppressed because it is too large
View File


+ 1
- 1
edivorce/apps/core/static/css/main.scss View File

@ -312,7 +312,7 @@ div.percent-prefix {
margin-top: 20px;
}
#unselected_spouse_property_alert {
#unselected_spouse_alert {
margin-bottom: 20px;
}
}


+ 23
- 3
edivorce/apps/core/static/js/main.js View File

@ -376,6 +376,12 @@ $(function () {
// If either Spousal support or Division of property and debts is not selected show alert message
// if user still wants to proceed(click next again), let them proceed to next page
// DIV-529 Separate alert for child support
$('input[name="want_which_orders"]').on('click', function() {
if ($(".checkbox-group input:checkbox").not(":checked").length === 0 ) {
$("#unselected_orders_alert").hide();
}
});
$('#check_order_selected').on('click', function (e) {
var showAlert = $(this).data('show_alert');
var childSupport = $('input[data-target_id=child_support_alert]').prop('checked');
@ -389,17 +395,31 @@ $(function () {
eligible = children === 'YES' && (under19 > 0 || (over19 > 0 && reasons));
}
var proceedNext = $(this).data('proceed');
var showPropertyAlert = false;
var showSpousalAlert = false;
if (!showAlert) {
$(".checkbox-group input:checkbox").not(":checked").each(function () {
if ($(this).val() === 'Division of property and debts' || $(this).val() === 'Spousal support') {
if ($(this).val() === 'Division of property and debts') {
showPropertyAlert = true;
showAlert = true;
}
if ($(this).val() === 'Spousal support') {
showSpousalAlert = true;
showAlert = true;
}
});
}
if ((showAlert || (!childSupport && eligible)) && !proceedNext) {
$('#unselected_orders_alert').show();
if (showAlert) { $('#unselected_spouse_property_alert').show(); }
if (!childSupport && eligible) { $('#unselected_child_support_alert').show(); }
if (showPropertyAlert) {
$('#unselected_property_alert').show();
}
if (showSpousalAlert) {
$('#unselected_spouse_alert').show();
}
if (!childSupport && eligible) {
$('#unselected_child_support_alert').show();
}
e.preventDefault();
$(this).data('proceed', true);
}


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

@ -45,7 +45,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="Spousal support" data_target_id="spouse_support_alert" data_invert_target=".orders-alert" data_reveal_target="true" %}
{% input_field type="checkbox" name="want_which_orders" value="Spousal support" data_target_id="spouse_support_alert" data_invert_target=".orders-alert-spouse-support" data_reveal_target="true" %}
<b>Spousal support</b>
</label>
</div>
@ -115,7 +115,7 @@ asked to provide details for each request.</p>
</div>
<div class="question-well">
<div class="checkbox"><label>{% input_field type="checkbox" name="want_which_orders" value="Division of property and debts" id="child_support" data_target_id="property_division_alert" data_reveal_target="true" %}<b>Division of property and debts</b></label></div>
<div class="checkbox"><label>{% input_field type="checkbox" name="want_which_orders" value="Division of property and debts" id="child_support" data_target_id="property_division_alert" data_invert_target=".orders-alert-property" data_reveal_target="true" %}<b>Division of property and debts</b></label></div>
<p>
Anything you own including real estate, bank accounts, cars and
@ -146,7 +146,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" data_target_id="child_support_alert" data_invert_target=".orders-alert" data_reveal_target="true" %}
{% input_field type="checkbox" name="want_which_orders" value="Child support" data_target_id="child_support_alert" data_invert_target=".orders-alert-child-support" data_reveal_target="true" %}
<b>Child Support</b>
</label>
<span class="tooltip-link" data-toggle="tooltip" data-placement="auto"
@ -202,20 +202,14 @@ asked to provide details for each request.</p>
<div class="checkbox"><label>{% input_field type="checkbox" name="want_which_orders" value="Child support" %}<b>Child support (Out of scope)</b></label></div>
{% endcomment %}
<div class="information-message bg-danger add-top-margin orders-alert" id="unselected_orders_alert" hidden>
<div class="orders-alert" id="unselected_spouse_property_alert" hidden>
<p>We've noticed that at this point in time you are not applying for
<div class="information-message bg-danger add-top-margin" id="unselected_orders_alert" hidden>
<p>
We've noticed that at this point in time you are not applying for
spousal support and/or division of property, debt, or a pension. If you
decide to request these items in the future there are some time
limits.</p>
<h2>Division of Property and Debts</h2>
<p>If you were married, you must apply to divide property within two
years after you get an order for divorce. If you were living in a
marriage-like relationship for at least two years, you must apply
within two years of the date you separated.</p>
decide to request these items in the future there are some time limits.
</p>
<div class="orders-alert-spouse-support" id="unselected_spouse_alert" hidden>
<h2>Spousal Support</h2>
<p>If you were married, you must apply for spousal support under the
@ -227,7 +221,15 @@ asked to provide details for each request.</p>
apply within two years of the date you separated.</p>
</div>
<div id="unselected_child_support_alert"
<div class="orders-alert-property" id="unselected_property_alert" hidden>
<h2>Division of Property and Debts</h2>
<p>If you were married, you must apply to divide property within two
years after you get an order for divorce. If you were living in a
marriage-like relationship for at least two years, you must apply
within two years of the date you separated.</p>
</div>
<div class="orders-alert-child-support" id="unselected_child_support_alert"
data-children-of-marriage="{{ children_of_marriage }}"
data-children-number-under-19="{{ number_children_under_19 }}"
data-children-number-over-19="{{ number_children_over_19 }}"


Loading…
Cancel
Save