From 5154233b9e8d9c905752da7dc597a08e5a645e59 Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Wed, 1 Mar 2017 16:24:30 -0800 Subject: [PATCH] Added some placeholder questions related to rest of forms --- edivorce/apps/core/static/js/controllers.js | 2 +- edivorce/apps/core/static/js/main.js | 14 ++- edivorce/apps/core/templates/overview.html | 1 + .../core/templates/partials/alias_field.html | 6 +- .../templates/partials/name_with_alias.html | 11 +++ edivorce/apps/core/templates/pdf/form1.html | 4 +- edivorce/apps/core/templates/pdf/form35.html | 28 ++++-- edivorce/apps/core/templates/pdf/form36.html | 6 +- .../templates/question/12_uncategorized.html | 98 +++++++++++++++++++ edivorce/fixtures/Question.json | 24 +++++ 10 files changed, 175 insertions(+), 19 deletions(-) create mode 100644 edivorce/apps/core/templates/partials/name_with_alias.html create mode 100644 edivorce/apps/core/templates/question/12_uncategorized.html diff --git a/edivorce/apps/core/static/js/controllers.js b/edivorce/apps/core/static/js/controllers.js index 4dd85ba6..90ca9241 100644 --- a/edivorce/apps/core/static/js/controllers.js +++ b/edivorce/apps/core/static/js/controllers.js @@ -83,7 +83,7 @@ var getValue = function(el, question){ if (question == "children_financial_support"){ childSupportCheckboxControl(el); } - $(".checkbox-group").find("input[type=checkbox]:checked").each(function(){ + el.parents(".checkbox-group").find("input[type=checkbox]:checked").each(function(){ value.push($(this).val()); }); // to remove last space and semi-colon diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index c1bda616..becc374d 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -26,10 +26,18 @@ $(function () { // Delete button will remove field and update user responses $(".btn-delete").on('click', function () { - // store neighbour input text to trigger change event to update list after delete - var neighbour = $(this).parent('div').prev().find("input:text"); $(this).parent('div').remove(); - neighbour.triggerHandler('change'); + + // update by trigger change event on one of the text field + var textField = $('#other_names_fields').find('input:text'); + textField.first().triggerHandler('change'); + + // when there is only one field left, clear it instead of delete it + if (textField.length < 1){ + $("#btn_add_other_names").triggerHandler('click'); + $('#other_names_fields').find('input:text').first().triggerHandler('change'); + } + }); // Configuration for datepicker diff --git a/edivorce/apps/core/templates/overview.html b/edivorce/apps/core/templates/overview.html index 1b743647..827e4168 100644 --- a/edivorce/apps/core/templates/overview.html +++ b/edivorce/apps/core/templates/overview.html @@ -18,6 +18,7 @@
  • Step 9: Other questions

    {{other_questions}}

  • Step 10: Filing locations

    {{filing_locations}}

  • Step 11: Review
  • +
  • Step 12: Uncategorized
  • Prepare your forms

    diff --git a/edivorce/apps/core/templates/partials/alias_field.html b/edivorce/apps/core/templates/partials/alias_field.html index bc65bb60..966e27f9 100644 --- a/edivorce/apps/core/templates/partials/alias_field.html +++ b/edivorce/apps/core/templates/partials/alias_field.html @@ -1,8 +1,10 @@ {% load input_field %}
    - - + + + {% input_field type="text" name=name value=value class="form-block input-wide response-textbox" %} {% if delete_button == "true" %} diff --git a/edivorce/apps/core/templates/partials/name_with_alias.html b/edivorce/apps/core/templates/partials/name_with_alias.html new file mode 100644 index 00000000..2e421ebc --- /dev/null +++ b/edivorce/apps/core/templates/partials/name_with_alias.html @@ -0,0 +1,11 @@ +{% load input_field %} +
    + + {{ name }} + {% if other_names %} + {% multiple_values_to_list source=other_names as values %} + {% for alias_type, value in values %} + {% if value != '' and value != ' ' %} {{alias_type}} {{value}} {% endif %} + {% endfor %} + {% endif %} + \ No newline at end of file diff --git a/edivorce/apps/core/templates/pdf/form1.html b/edivorce/apps/core/templates/pdf/form1.html index d0c45ebe..c208767c 100644 --- a/edivorce/apps/core/templates/pdf/form1.html +++ b/edivorce/apps/core/templates/pdf/form1.html @@ -31,10 +31,10 @@ In the Supreme Court of British Columbia

    - Claimant 1:
    {{ responses.name_you }} + Claimant 1:{% include "partials/name_with_alias.html" with name=responses.name_you other_names=responses.other_name_you %}

    - Claimant 2:
    {{ responses.name_spouse }} + Claimant 2:{% include "partials/name_with_alias.html" with name=responses.name_spouse other_names=responses.other_name_spouse %}

      diff --git a/edivorce/apps/core/templates/pdf/form35.html b/edivorce/apps/core/templates/pdf/form35.html index 30251879..10dc0e1b 100644 --- a/edivorce/apps/core/templates/pdf/form35.html +++ b/edivorce/apps/core/templates/pdf/form35.html @@ -1,4 +1,5 @@ {% load static %} +{% load input_field %} @@ -31,10 +32,12 @@ In the Supreme Court of British Columbia

    - Claimant 1: {% if responses.name_you %} {{ responses.name_you }} {% else %}   {% endif %} + Claimant 1: {% if responses.name_you %} {% include "partials/name_with_alias.html" with name=responses.name_you other_names=responses.other_name_you %} + {% else %}   {% endif %}

    - Claimant 2: {% if responses.name_spouse %} {{ responses.name_spouse }} {% else %}   {% endif %} + Claimant 2: {% if responses.name_spouse %} {% include "partials/name_with_alias.html" with name=responses.name_spouse other_names=responses.other_name_spouse %} + {% else %}   {% endif %}

    REQUISITION @@ -58,23 +61,28 @@

    [Check all of the following boxes and file the following with this requisition.]

    + {% check_list source=responses.form35_dummy_requisition value='option1' as dummy_option %}

    - draft of the order sought; + draft of the order sought;

    + {% check_list source=responses.form35_dummy_requisition value='option2' as dummy_option %}

    - proof that the case is an undefended family law case; + proof that the case is an undefended family law case;

    + {% check_list source=responses.form35_dummy_requisition value='option3' as dummy_option %}

    - certificate of the registrar in Form F36; + certificate of the registrar in Form F36;

    + {% check_list source=responses.form35_dummy_requisition value='option4' as dummy_option %}

    - filing fee. + filing fee.

    [Check the following box and file the following with this requisition unless a response to family claim or response to counterclaim has been filed or unless this case is a joint family law case within the meaning of Rule 2-2 of the Supreme Court Family Rules.]

    + {% check_list source=responses.form35_dummy_additional value='option1' as dummy_option %}

    - proof of service of the notice of family claim or counterclaim, as the case may be. + proof of service of the notice of family claim or counterclaim, as the case may be.

    [Check the following box and file the following document with this requisition if @@ -87,14 +95,16 @@

    (b) the family law case includes a claim for child support.]

    + {% check_list source=responses.form35_dummy_additional value='option2' as dummy_option %}

    - Child Support Affidavit in Form F37. + Child Support Affidavit in Form F37.

    [Check the following box and file the following document with this requisition if a divorce is sought.]

    + {% check_list source=responses.form35_dummy_additional value='option3' as dummy_option %}

    - affidavit in Form F38. + affidavit in Form F38.

    diff --git a/edivorce/apps/core/templates/pdf/form36.html b/edivorce/apps/core/templates/pdf/form36.html index 1f2cb30d..e011443c 100644 --- a/edivorce/apps/core/templates/pdf/form36.html +++ b/edivorce/apps/core/templates/pdf/form36.html @@ -31,10 +31,12 @@ In the Supreme Court of British Columbia

    - Claimant 1: {% if responses.name_you %} {{ responses.name_you }} {% else %}   {% endif %} + Claimant 1: {% if responses.name_you %} {% include "partials/name_with_alias.html" with name=responses.name_you other_names=responses.other_name_you %} + {% else %}   {% endif %}

    - Claimant 2: {% if responses.name_spouse %} {{ responses.name_spouse }} {% else %}   {% endif %} + Claimant 2: {% if responses.name_spouse %} {% include "partials/name_with_alias.html" with name=responses.name_spouse other_names=responses.other_name_spouse %} + {% else %}   {% endif %}

    CERTIFICATE OF PLEADINGS diff --git a/edivorce/apps/core/templates/question/12_uncategorized.html b/edivorce/apps/core/templates/question/12_uncategorized.html new file mode 100644 index 00000000..af03a047 --- /dev/null +++ b/edivorce/apps/core/templates/question/12_uncategorized.html @@ -0,0 +1,98 @@ +{% extends 'base.html' %}{% load input_field %} + +{% block title %}{{ block.super }}: Review{% endblock %} + +{% block content %} +
    +
    +
    +
    +
    +

    FORM 35

    +

    Filed with this requisition are:

    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +

    Additional request:

    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    FORM 38

    +
    +

    Will you be swearing/affirming your affidavit together at the registry? Or will you be doing this separately?

    +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    FORM 52

    +
    + +
    + +
    +
    +
    +
    +
    +{% endblock %} \ No newline at end of file diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index a34ce230..f1097e0e 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -502,5 +502,29 @@ }, "model": "core.question", "pk": "address_to_send_official_document_email_spouse" +}, +{ + "fields": { + "name": "Form 35 requisition dummy question", + "description": "DUMMY QUESTION for form 35 first question" + }, + "model": "core.question", + "pk": "form35_dummy_requisition" +}, +{ + "fields": { + "name": "Form 35 additional dummy question", + "description": "DUMMY QUESTION for form 35 second question" + }, + "model": "core.question", + "pk": "form35_dummy_additional" +}, +{ + "fields": { + "name": "Will you be swearing/affirming your affidavit together at the registry? Or will you be doing this separately?", + "description": "DUMMY QUESTION for form 38 first question" + }, + "model": "core.question", + "pk": "form38_dummy_together" } ]