From 9979b6d6a2d992d116c73309da51523e2a195c90 Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Mon, 20 Feb 2017 16:17:08 -0800 Subject: [PATCH] Added second address fields and textarea for property section --- .gitignore | 3 + edivorce/apps/core/static/js/ajax.js | 1 + edivorce/apps/core/static/js/controllers.js | 2 +- edivorce/apps/core/static/js/main.js | 2 +- .../apps/core/templates/f1/02_claimant.html | 2 +- .../apps/core/templates/f1/03_respondent.html | 2 +- .../apps/core/templates/f1/04_marriage.html | 6 +- .../apps/core/templates/f1/05_reason.html | 4 +- .../apps/core/templates/f1/06_support.html | 20 ++--- .../apps/core/templates/f1/07_property.html | 33 +++---- .../apps/core/templates/f1/10_location.html | 70 +++++++++++---- edivorce/apps/core/templates/pdf/form1.html | 19 ++-- .../apps/core/utils/question_step_mapping.py | 4 +- edivorce/fixtures/Question.json | 86 +++++++++++++++++-- 14 files changed, 184 insertions(+), 70 deletions(-) diff --git a/.gitignore b/.gitignore index a7763bba..897ce864 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ target/ # Local env settings .env* + +# IDE +.idea/ diff --git a/edivorce/apps/core/static/js/ajax.js b/edivorce/apps/core/static/js/ajax.js index 1c8100b3..cf3d1fd2 100644 --- a/edivorce/apps/core/static/js/ajax.js +++ b/edivorce/apps/core/static/js/ajax.js @@ -24,6 +24,7 @@ var ajaxOnChange = function () { } else{ console.log("Invalid input for " + el.prop('name')); + window.alert("Invalid input for " + el.prop('name')); } }; diff --git a/edivorce/apps/core/static/js/controllers.js b/edivorce/apps/core/static/js/controllers.js index ac7f1328..be149138 100644 --- a/edivorce/apps/core/static/js/controllers.js +++ b/edivorce/apps/core/static/js/controllers.js @@ -68,7 +68,7 @@ var radioWithTextboxControl = function(el){ // when textbox is clicked, update associated radio button response with its value else if (el.is(".other-textbox")){ - var radioTextbox = $("#radio_with_textbox"); + var radioTextbox = el.siblings(".radio_with_textbox"); ajaxCall(radioTextbox.prop('name'), radioTextbox.val()); } }; diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 58a1892d..7ec3bb4d 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -14,7 +14,7 @@ $(function () { // when user click textbox beside radio button, check the associated radio button $(".other-textbox").on("click", function(){ - $("#radio_with_textbox").prop('checked', true); + $(this).siblings(".radio_with_textbox").prop('checked', true); }); $("input[type=radio], input[type=checkbox], input[type=text], .response-textarea, .response-dropdown").on("change", ajaxOnChange); diff --git a/edivorce/apps/core/templates/f1/02_claimant.html b/edivorce/apps/core/templates/f1/02_claimant.html index dfd1714d..7460d417 100644 --- a/edivorce/apps/core/templates/f1/02_claimant.html +++ b/edivorce/apps/core/templates/f1/02_claimant.html @@ -113,7 +113,7 @@

How long have you lived in British Columbia?

Please select one

-
+

In order to apply for a divorce in British Columbia, you or your spouse must have been a regular resident in B.C (the legal term is ordinarily resident diff --git a/edivorce/apps/core/templates/f1/03_respondent.html b/edivorce/apps/core/templates/f1/03_respondent.html index 2d5bb7d8..82b2ad58 100644 --- a/edivorce/apps/core/templates/f1/03_respondent.html +++ b/edivorce/apps/core/templates/f1/03_respondent.html @@ -115,7 +115,7 @@

How long has your spouse lived in British Columbia?

Please select one

-
+

In order to apply for a divorce in British Columbia, you or your spouse must have been a regular resident in B.C (the legal term is ordinarily resident diff --git a/edivorce/apps/core/templates/f1/04_marriage.html b/edivorce/apps/core/templates/f1/04_marriage.html index 07a482e3..9d841d0b 100644 --- a/edivorce/apps/core/templates/f1/04_marriage.html +++ b/edivorce/apps/core/templates/f1/04_marriage.html @@ -63,8 +63,8 @@

If you cannot remember the exact date you sepearated then enter:

@@ -81,7 +81,7 @@
-
+
diff --git a/edivorce/apps/core/templates/f1/05_reason.html b/edivorce/apps/core/templates/f1/05_reason.html index 7fb291b8..2cea70ab 100644 --- a/edivorce/apps/core/templates/f1/05_reason.html +++ b/edivorce/apps/core/templates/f1/05_reason.html @@ -98,8 +98,8 @@

You can also get a divorce if:

    -
  • - you or your spouse has committed adultery (been unfaithful) that hasn't been forgiven, or
  • -
  • - your spouse treated you with physical or mental cruelty that you haven't forgiven, which makes it impossible for you to continue to live together.
  • +
  • you or your spouse has committed adultery (been unfaithful) that hasn't been forgiven, or
  • +
  • your spouse treated you with physical or mental cruelty that you haven't forgiven, which makes it impossible for you to continue to live together.

To get a divorce for these reasons you have to prove these things in court.

diff --git a/edivorce/apps/core/templates/f1/06_support.html b/edivorce/apps/core/templates/f1/06_support.html index 63dce05e..da14e559 100644 --- a/edivorce/apps/core/templates/f1/06_support.html +++ b/edivorce/apps/core/templates/f1/06_support.html @@ -23,10 +23,10 @@

The amount and duration of spousal support is determined after considering the circumstances of each spouse, including:

    -
  • - Your financial situation and the financial situation of your former spouse
  • -
  • - How long your relationship lasted
  • -
  • - The roles and functions of each spouse during the relationship, and
  • -
  • - What the person who is asking for spousal support needs in order to become self-sufficient, such as extra training or education.
  • +
  • Your financial situation and the financial situation of your former spouse
  • +
  • How long your relationship lasted
  • +
  • The roles and functions of each spouse during the relationship, and
  • +
  • What the person who is asking for spousal support needs in order to become self-sufficient, such as extra training or education.

MySupportCalculator.ca is a website with a support calculator which can give you a rough estimate of spousal support." The guidelines and calculations are complicated so you may want to contact a family law lawyer or a family justice counesllor for help. @@ -51,8 +51,8 @@

If you're applying for an undefended divorce and asking for spousal support, make sure you fill in:

    -
  • - the amount of support you want, and
  • -
  • - an amount for your spouse's income. If you aren't sure, make your best estimate.
  • +
  • the amount of support you want, and
  • +
  • an amount for your spouse's income. If you aren't sure, make your best estimate.

If you don't provide this information, the court may not make an order.

@@ -128,10 +128,10 @@

What is spousal support?

The objectives of spousal support are to:

    -
  • - Deal with any economic advantages or disadvantages a spouse may face as a result of the relationship or separation
  • -
  • - Share the financial consequences arising from care of the children
  • -
  • - Reduce the financial hardship a spouse will experience as a result of the separation, and
  • -
  • - Encourage each spouse to become financially self-sufficient within a reasonable period of time.
  • +
  • Deal with any economic advantages or disadvantages a spouse may face as a result of the relationship or separation
  • +
  • Share the financial consequences arising from care of the children
  • +
  • Reduce the financial hardship a spouse will experience as a result of the separation, and
  • +
  • Encourage each spouse to become financially self-sufficient within a reasonable period of time.
diff --git a/edivorce/apps/core/templates/f1/07_property.html b/edivorce/apps/core/templates/f1/07_property.html index 8d68c5e3..df028b69 100644 --- a/edivorce/apps/core/templates/f1/07_property.html +++ b/edivorce/apps/core/templates/f1/07_property.html @@ -29,13 +29,13 @@

Family property is everything either you or your spouse own together or separately on the date you separate. It includes:

    -
  • - the family home
  • -
  • - RRSPs
  • -
  • - investments
  • -
  • - bank accounts
  • -
  • - insurance policies
  • -
  • - pensions
  • -
  • - an interest in a business
  • +
  • the family home
  • +
  • RRSPs
  • +
  • investments
  • +
  • bank accounts
  • +
  • insurance policies
  • +
  • pensions
  • +
  • an interest in a business

It doesn't matter whose name the property is in.

@@ -99,7 +99,8 @@

Please describe how you and your spouse plan to divide your property, assets and your debts.

Because the division of family property and debt can be complex we recommend you get legal advice - before you make any final decisions.

+ before you make any final decisions. +

Other Property Claims

This section is about excluded property - e.g. property owned by the respondent at the time you moved in together, and gifts or inheritances the respondent received. Compensation is cash instead of ownership of your share of the property.

+ {% input_option type="textarea" name="other_property_claims" rows="8" cols="65" class="response-textarea" %}
@@ -147,10 +150,10 @@

Where to Find Out More About Dealing with Property and Debt

For more information about dealing with Property and Debt, please visit:

diff --git a/edivorce/apps/core/templates/f1/10_location.html b/edivorce/apps/core/templates/f1/10_location.html index 944bf273..2caacfe1 100644 --- a/edivorce/apps/core/templates/f1/10_location.html +++ b/edivorce/apps/core/templates/f1/10_location.html @@ -29,31 +29,63 @@
-

What is the best address to send you official court documents?

-

This is known as your "address for service"

-

House and street number

- {% input_option type="text" name="address_to_send_official_document_street" class="response-textbox" %} -

City

- {% input_option type="text" name="address_to_send_official_document_city" class="response-textbox" %} -

Prov/State

- {% input_option type="text" name="address_to_send_official_document_prov" class="response-textbox" %} +
+

What is the best address to send you official court documents?

+

This is known as your "address for service"

+

House and street number

+ {% input_option type="text" name="address_to_send_official_document_street_you" class="response-textbox" %} +

City

+ {% input_option type="text" name="address_to_send_official_document_city_you" class="response-textbox" %} +

Prov/State

+ {% input_option type="text" name="address_to_send_official_document_prov_you" class="response-textbox" %} -

Country

+

Country

-
-
-
+
+
+
+
+ +
+

If you don’t live within 30 km of a court registry, you must provide a fax number or email address. + If you main address is a PO box, you can list this instead of the fax or email but you must also list + an address that’s not a PO box.

+ +

Fax number (optional)

+ {% input_option type="text" name="address_to_send_official_document_fax_you" class="response-textbox" %} +

Email Address (optional)

+ {% input_option type="text" id="email_textbox" name="address_to_send_official_document_email_you" class="response-textbox" %} +
-

If you don’t live within 30 km of a court registry, you must provide a fax number or email address. - If you main address is a PO box, you can list this instead of the fax or email but you must also list - an address that’s not a PO box.

+
+

What is the best address to send your spouse official court documents?

+

This is known as your "address for service"

+

House and street number

+ {% input_option type="text" name="address_to_send_official_document_street_spouse" class="response-textbox" %} +

City

+ {% input_option type="text" name="address_to_send_official_document_city_spouse" class="response-textbox" %} +

Prov/State

+ {% input_option type="text" name="address_to_send_official_document_prov_spouse" class="response-textbox" %} + +

Country

+ +
+
+
+
+ +
+

If your spouse doesn’t live within 30 km of a court registry, your spouse must provide a fax number or email address. + If your spouse's main address is a PO box, your spouse can list this instead of the fax or email but your spouse must also list + an address that’s not a PO box.

-

Fax number (optional)

- {% input_option type="text" name="address_to_send_official_document_fax" class="response-textbox" %} -

Email Address (optional)

- {% input_option type="text" id="email_textbox" name="address_to_send_official_document_email" class="response-textbox" %} +

Fax number (optional)

+ {% input_option type="text" name="address_to_send_official_document_fax_spouse" class="response-textbox" %} +

Email Address (optional)

+ {% input_option type="text" id="email_textbox" name="address_to_send_official_document_email_spouse" class="response-textbox" %} +
diff --git a/edivorce/apps/core/templates/pdf/form1.html b/edivorce/apps/core/templates/pdf/form1.html index a20d621b..85d75ff4 100644 --- a/edivorce/apps/core/templates/pdf/form1.html +++ b/edivorce/apps/core/templates/pdf/form1.html @@ -361,16 +361,19 @@

Claimant 1: - {% if responses.address_to_send_official_document_street and responses.address_to_send_official_document_city and responses.address_to_send_official_document_prov and responses.address_to_send_official_document_country %} - {{ responses.address_to_send_official_document_street }}, {{ responses.address_to_send_official_document_city }}, {{ responses.address_to_send_official_document_prov }}, - {% if responses.address_to_send_official_document_country == 'Other' %} {{ responses.address_to_send_official_document_other_country }} {% else %} {{ responses.address_to_send_official_document_country }} {% endif %} {% else %}   {% endif %}

-

Fax (optional) {% if responses.address_to_send_official_document_fax %} {{ responses.address_to_send_official_document_fax }} {% else %}   {% endif %}

-

E-mail (optional) {% if responses.address_to_send_official_document_email %} {{ responses.address_to_send_official_document_email }} {% else %}   {% endif %}

+ {% if responses.address_to_send_official_document_street_you and responses.address_to_send_official_document_city_you and responses.address_to_send_official_document_prov_you and responses.address_to_send_official_document_country_you %} + {{ responses.address_to_send_official_document_street_you }}, {{ responses.address_to_send_official_document_city_you }}, {{ responses.address_to_send_official_document_prov_you }}, + {% if responses.address_to_send_official_document_country_you == 'Other' %} {{ responses.address_to_send_official_document_other_country_you }} {% else %} {{ responses.address_to_send_official_document_country_you }} {% endif %} {% else %}   {% endif %}

+

Fax (optional) {% if responses.address_to_send_official_document_fax_you %} {{ responses.address_to_send_official_document_fax_you }} {% else %}   {% endif %}

+

E-mail (optional) {% if responses.address_to_send_official_document_email_you %} {{ responses.address_to_send_official_document_email_you }} {% else %}   {% endif %}

-

Claimant 2:  

-

Fax (optional)  

-

E-mail (optional)  

+

Claimant 2: + {% if responses.address_to_send_official_document_street_spouse and responses.address_to_send_official_document_city_spouse and responses.address_to_send_official_document_prov_spouse and responses.address_to_send_official_document_country_spouse %} + {{ responses.address_to_send_official_document_street_spouse }}, {{ responses.address_to_send_official_document_city_spouse }}, {{ responses.address_to_send_official_document_prov_spouse }}, + {% if responses.address_to_send_official_document_country_spouse == 'Other' %} {{ responses.address_to_send_official_document_other_country_spouse }} {% else %} {{ responses.address_to_send_official_document_country_spouse }} {% endif %} {% else %}   {% endif %}

+

Fax (optional) {% if responses.address_to_send_official_document_fax_spouse %} {{ responses.address_to_send_official_document_fax_spouse }} {% else %}   {% endif %}

+

E-mail (optional) {% if responses.address_to_send_official_document_email_spouse %} {{ responses.address_to_send_official_document_email_spouse }} {% else %}   {% endif %}

diff --git a/edivorce/apps/core/utils/question_step_mapping.py b/edivorce/apps/core/utils/question_step_mapping.py index ad0ea750..410df3a5 100644 --- a/edivorce/apps/core/utils/question_step_mapping.py +++ b/edivorce/apps/core/utils/question_step_mapping.py @@ -15,8 +15,8 @@ question_step_mapping = {'prequalification': ['married_marriage_like', 'lived_in 'where_were_you_married_country', 'where_were_you_married_other_country', 'marital_status_before_you', 'marital_status_before_spouse',], 'your_separation': ['no_reconciliation_possible', 'no_collusion',], - 'spousal_support': ['spouse_support_details', 'spouse_support_act'], - 'property_and_debt': ['deal_with_property_debt'], + 'spousal_support': ['spouse_support_details', 'spouse_support_act',], + 'property_and_debt': ['deal_with_property_debt', 'how_to_divide_property_debt', 'other_property_claims',], 'other_orders': [], 'other_questions': [], 'filing_locations': ['address_to_send_official_document_street', 'address_to_send_official_document_city', diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index a09d6b03..29c9eefa 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -351,6 +351,22 @@ "model": "core.question", "pk": "deal_with_property_debt" }, +{ + "fields": { + "name": "Please describe how you and your spouse plan to divide your property, assets and your debts.", + "description": "For step 7, Form 1 6. Property and debt" + }, + "model": "core.question", + "pk": "how_to_divide_property_debt" +}, +{ + "fields": { + "name": "Other Property Claims", + "description": "For step 7, Form 1 6. Property and debt" + }, + "model": "core.question", + "pk": "other_property_claims" +}, { "fields": { "name": "At what court registry will you be filing?", @@ -365,7 +381,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_street" + "pk": "address_to_send_official_document_street_you" }, { "fields": { @@ -373,7 +389,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_city" + "pk": "address_to_send_official_document_city_you" }, { "fields": { @@ -381,7 +397,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_prov" + "pk": "address_to_send_official_document_prov_you" }, { "fields": { @@ -389,7 +405,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_country" + "pk": "address_to_send_official_document_country_you" }, { "fields": { @@ -397,7 +413,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_other_country" + "pk": "address_to_send_official_document_other_country_you" }, { "fields": { @@ -405,7 +421,7 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_fax" + "pk": "address_to_send_official_document_fax_you" }, { "fields": { @@ -413,6 +429,62 @@ "description": "For step 10, Form 1 8. Claimants' addresses for service" }, "model": "core.question", - "pk": "address_to_send_official_document_email" + "pk": "address_to_send_official_document_email_you" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Street Number", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_street_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? City", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_city_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Prov", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_prov_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Country", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_country_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Other Country", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_other_country_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Fax number", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_fax_spouse" +}, +{ + "fields": { + "name": "What is the best address to send your spouse official court documents? Email", + "description": "For step 10, Form 1 8. Claimants' addresses for service" + }, + "model": "core.question", + "pk": "address_to_send_official_document_email_spouse" } ]