From 74c123ba8d09f0289dd9c7216ff873f0f896aaa7 Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Thu, 17 Jan 2019 16:30:39 -0800 Subject: [PATCH 1/3] DIV-915: Updated show logic for have court order and parent arrangements questions. --- .../apps/core/templates/question/06_children_what_for.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index 7a70965d..f96a751c 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -177,8 +177,6 @@ - - {% if 'Child support' in want_which_orders|load_json %}

Do you have a + {% if 'Child support' in want_which_orders|load_json %}

If you are asking the court to include an Date: Fri, 18 Jan 2019 14:31:16 -0800 Subject: [PATCH 2/3] DIV-917: Updated reveal logic for order_for_child_support question. --- edivorce/apps/core/static/js/functions.js | 9 +++++++++ edivorce/apps/core/templates/pdf/form1.html | 9 +++++++-- edivorce/apps/core/templates/pdf/form52.html | 9 +++++---- .../core/templates/question/06_children_what_for.html | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 8b0f20e2..3b0c9a03 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -91,6 +91,10 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) { if (id === "#has_children") { reveal($("input[name=number_children_over_19]")); } + // Special case of hide child support description. + if (id === "#child_support_in_order_detail") { + $("#child_support_description").hide(); + } // reveal nested question as well if (id === "#marriage_certificate") { @@ -115,6 +119,11 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) { $(el.data("reveal_force_hide_group")).find(':radio').prop('checked', false); } + // Special case of show child support description. + if (id === "#child_support_in_order_detail") { + $("#child_support_description").show(); + } + if (relatedId !== undefined){ $('#' + relatedId).show(); } diff --git a/edivorce/apps/core/templates/pdf/form1.html b/edivorce/apps/core/templates/pdf/form1.html index 0d23a383..315ca524 100644 --- a/edivorce/apps/core/templates/pdf/form1.html +++ b/edivorce/apps/core/templates/pdf/form1.html @@ -437,13 +437,18 @@ - B. {% checkbox responses.order_for_child_support children_of_marriage='YES' want_which_orders='Child support' %} + B. + {% if responses.child_support_in_order == 'NO' %} + {% checkbox false %} + {% else %} + {% checkbox responses.order_for_child_support children_of_marriage='YES' want_which_orders='Child support' %} + {% endif %}
Claimant 1 and Claimant 2 are asking for an order for child support as follows: - {% if responses.children_of_marriage == 'YES' and responses.order_for_child_support and 'Child support' in responses.want_which_orders %} + {% if responses.children_of_marriage == 'YES' and responses.order_for_child_support and 'Child support' in responses.want_which_orders and responses.child_support_in_order != 'NO' %}
    {{ responses.order_for_child_support|striptags|linebreaksli }}
{% endif %}
diff --git a/edivorce/apps/core/templates/pdf/form52.html b/edivorce/apps/core/templates/pdf/form52.html index 16c1dd63..8df6f339 100644 --- a/edivorce/apps/core/templates/pdf/form52.html +++ b/edivorce/apps/core/templates/pdf/form52.html @@ -112,10 +112,11 @@ {% for order in derived.pursuant_parenting_arrangement %}
  • {{ order }}
  • {% endfor %} - - {% for order in derived.pursuant_child_support %} -
  • {{ order }}
  • - {% endfor %} + {% if responses.child_support_in_order != 'NO' %} + {% for order in derived.pursuant_child_support %} +
  • {{ order }}
  • + {% endfor %} + {% endif %} {% endif %} {% if responses.children_of_marriage == 'YES' and responses.special_extraordinary_expenses == 'YES' %} diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index f96a751c..c476b5ec 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -310,7 +310,7 @@ {% input_field type="textarea" name="order_respecting_arrangement" class="response-textarea form-control" maxlength="20000" rows="7"%}
    -
    +

    If you are asking for an Date: Mon, 21 Jan 2019 11:35:34 -0800 Subject: [PATCH 3/3] DIV-916: Added new question for asking for child support and updated related logics. --- edivorce/apps/core/static/js/functions.js | 6 ++++ edivorce/apps/core/templates/pdf/form1.html | 4 +-- .../question/06_children_what_for.html | 17 +++++++++-- .../apps/core/templatetags/summary_format.py | 5 ++-- .../apps/core/utils/question_step_mapping.py | 1 + edivorce/apps/core/utils/step_completeness.py | 8 ++++-- edivorce/apps/core/utils/user_response.py | 5 +++- edivorce/fixtures/Question.json | 28 +++++++++++++++---- 8 files changed, 59 insertions(+), 15 deletions(-) diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 3b0c9a03..399a3618 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -156,6 +156,12 @@ var showHideRevealClass = function(el, targetCssClass) { } else { if (targetCssClass !== undefined){ $('.' + targetCssClass).show(); + // This is to handle special case where multiple reveal options applied. + if (targetCssClass === 'support-amount-match') { + if ($("input[name=claimants_agree_to_child_support_amount]:checked").val() === 'YES') { + $('#what_special_provisions').hide(); + } + } } } }; diff --git a/edivorce/apps/core/templates/pdf/form1.html b/edivorce/apps/core/templates/pdf/form1.html index 315ca524..bd6d3580 100644 --- a/edivorce/apps/core/templates/pdf/form1.html +++ b/edivorce/apps/core/templates/pdf/form1.html @@ -420,14 +420,14 @@ - A. {% checkbox responses.order_respecting_arrangement children_of_marriage='YES' want_which_orders='Child support' %} + A. {% checkbox want_parenting_arrangements='YES' children_of_marriage='YES' want_which_orders='Child support' %}
    Claimant 1 and Claimant 2 are asking for the following order respecting arrangements for parenting or contact: - {% if responses.children_of_marriage == 'YES' and responses.order_respecting_arrangement and 'Child support' in responses.want_which_orders %} + {% if responses.children_of_marriage == 'YES' and responses.want_parenting_arrangements == 'YES' and responses.order_respecting_arrangement and 'Child support' in responses.want_which_orders %}
      {{ responses.order_respecting_arrangement|striptags|linebreaksli }}
    {% endif %}
    diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index c476b5ec..742b5b03 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -271,7 +271,7 @@ {% if 'Child support' in want_which_orders|load_json %}
    -

    If you are asking the court to include an +

    Are you asking the court for an order about parenting arrangements or contact - with a child, please indicate the orders you are asking for below. + with a child?

    +
    + + + +
    +
    + +