Browse Source

DIV-1135 - Part 1 - Split up name_you and name_spouse fields

pull/172/head
Michael Olund 5 years ago
parent
commit
e01a39f582
24 changed files with 430 additions and 262 deletions
  1. +41
    -0
      edivorce/apps/core/migrations/0023_auto_20201006_1314.py
  2. +7
    -0
      edivorce/apps/core/static/css/main.scss
  3. +2
    -2
      edivorce/apps/core/templates/pdf/form1.html
  4. +6
    -6
      edivorce/apps/core/templates/pdf/form35.html
  5. +5
    -4
      edivorce/apps/core/templates/pdf/form36.html
  6. +12
    -12
      edivorce/apps/core/templates/pdf/form37.html
  7. +10
    -10
      edivorce/apps/core/templates/pdf/form38.html
  8. +6
    -6
      edivorce/apps/core/templates/pdf/form52.html
  9. +10
    -10
      edivorce/apps/core/templates/pdf/form96.html
  10. +5
    -8
      edivorce/apps/core/templates/prequalification/step_03.html
  11. +11
    -4
      edivorce/apps/core/templates/question/02_claimant.html
  12. +11
    -4
      edivorce/apps/core/templates/question/03_respondent.html
  13. +4
    -3
      edivorce/apps/core/templates/question/04_marriage.html
  14. +2
    -1
      edivorce/apps/core/templates/question/05_separation.html
  15. +8
    -8
      edivorce/apps/core/templates/question/06_children_facts.html
  16. +3
    -2
      edivorce/apps/core/templates/question/06_children_payor_medical.html
  17. +4
    -5
      edivorce/apps/core/templates/question/06_children_your_children.html
  18. +5
    -4
      edivorce/apps/core/templates/question/07_support.html
  19. +8
    -8
      edivorce/apps/core/templates/question/08_property.html
  20. +40
    -4
      edivorce/apps/core/templatetags/format_utils.py
  21. +5
    -3
      edivorce/apps/core/tests/test_step_completeness.py
  22. +5
    -4
      edivorce/apps/core/utils/derived.py
  23. +8
    -2
      edivorce/apps/core/utils/question_step_mapping.py
  24. +212
    -152
      edivorce/fixtures/Question.json

+ 41
- 0
edivorce/apps/core/migrations/0023_auto_20201006_1314.py View File

@ -0,0 +1,41 @@
# Generated by Django 2.2.15 on 2020-10-06 20:14
from django.db import migrations
def migrate_name_forward(apps, schema_editor):
UserResponse = apps.get_model('core', 'UserResponse')
name_you_responses = UserResponse.objects.filter(question_id='name_you')
print(f"Converting {name_you_responses.count()} name_you responses")
for response in name_you_responses:
response.question_id = 'last_name_you'
response.save()
name_spouse_responses = UserResponse.objects.filter(question_id='name_spouse')
print(f"Converting {name_spouse_responses.count()} name_spouse responses")
for response in name_spouse_responses:
response.question_id = 'last_name_spouse'
response.save()
def migrate_name_backwards(apps, schema_editor):
UserResponse = apps.get_model('core', 'UserResponse')
last_name_you_responses = UserResponse.objects.filter(question_id='last_name_you')
print(f"Converting {last_name_you_responses.count()} last_name_you responses")
for response in last_name_you_responses:
response.question_id = 'name_you'
response.save()
last_name_spouse_responses = UserResponse.objects.filter(question_id='last_name_spouse')
print(f"Converting {last_name_spouse_responses.count()} last_name_spouse responses")
for response in last_name_spouse_responses:
response.question_id = 'name_spouse'
response.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0022_auto_20200928_1157'),
]
operations = [
migrations.RunPython(migrate_name_forward, migrate_name_backwards)
]

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

@ -847,6 +847,13 @@ input {
width: 70%;
}
&.input-medium {
width: 70%;
@media (min-width: 992px) {
width: 45%;
}
}
&.input-narrow {
max-width: 100px;
}


+ 2
- 2
edivorce/apps/core/templates/pdf/form1.html View File

@ -38,11 +38,11 @@
</p>
<p>
<span class="claimant-label">Claimant 1:</span>
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
</p>
<p>
<span class="claimant-label">Claimant 2:</span>
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
</p>
<p>
&nbsp;


+ 6
- 6
edivorce/apps/core/templates/pdf/form35.html View File

@ -36,16 +36,16 @@
</p>
<p>
<span class="claimant-label">Claimant 1:</span>
{% if responses.name_you %}
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% if responses|name_you %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}
</p>
<p>
<span class="claimant-label">Claimant 2:</span>
{% if responses.name_spouse %}
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% if responses|name_spouse %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}
@ -56,10 +56,10 @@
</p>
<p>
<strong>Filed by:</strong> {{ responses.name_you }}
<strong>Filed by:</strong> {{ responses|name_you }}
</p>
<p>
<strong>Filed by:</strong> {{ responses.name_spouse }}
<strong>Filed by:</strong> {{ responses|name_spouse }}
</p>
<p>
Required: final order, without a hearing, in the form attached


+ 5
- 4
edivorce/apps/core/templates/pdf/form36.html View File

@ -1,4 +1,5 @@
{% load static %}
{% load format_utils %}
<!doctype html>
<html class="no-js" lang="en">
@ -34,16 +35,16 @@
</p>
<p>
<span class="claimant-label">Claimant 1:</span>
{% if responses.name_you %}
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% if responses|name_you %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}
</p>
<p>
<span class="claimant-label">Claimant 2:</span>
{% if responses.name_spouse %}
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% if responses|name_spouse %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}


+ 12
- 12
edivorce/apps/core/templates/pdf/form37.html View File

@ -38,11 +38,11 @@
This is the <span class="form-entry-sm not-complete form-underline"></span> affidavit<br>
of
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% required responses.name_you %}
{% required responses|name_you %}
{% endif %}
{% if responses.which_claimant == 'both' %}and<br>{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% required responses.name_spouse %}
{% required responses|name_spouse %}
{% endif %}
in this case,<br>
and was made on <span class="form-entry-md not-complete form-underline"></span>
@ -56,11 +56,11 @@
<p>Claimant 1:</p>
<p>{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}</p>
<p>{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}</p>
<p>Claimant 2:</p>
<p>{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}</p>
<p>{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}</p>
<h1 class="text-center">
CHILD SUPPORT AFFIDAVIT
@ -70,8 +70,8 @@
{% if responses.which_claimant == 'both' %}We{% else %}I{% endif %},
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% if responses.name_you %}
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}
{% if responses|name_you %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}
{% else %}<span class="form-entry not-complete"></span>{% endif %},
of
@ -93,8 +93,8 @@
{% if responses.which_claimant == 'both' %}and<br />{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% if responses.name_spouse %}
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}
{% if responses|name_spouse %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}
{% else %}<span class="form-entry not-complete"></span>{% endif %}, of
{% required responses.address_to_send_official_document_street_spouse trail=',' %}
@ -136,7 +136,7 @@
<th style="text-align: left">Province of residence</th>
</tr>
<tr>
<td>{% response responses.name_you %}</td>
<td>{% response responses|name_you %}</td>
<td>{% response responses.address_to_send_official_document_prov_you %}</td>
</tr>
<tr>
@ -144,7 +144,7 @@
<th style="text-align: left">Province of residence</th>
</tr>
<tr>
<td>{% response responses.name_spouse %}</td>
<td>{% response responses|name_spouse %}</td>
<td>{% response responses.address_to_send_official_document_prov_spouse %}</td>
</tr>
</table>
@ -334,10 +334,10 @@
</ol>
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_you %}
{% include 'pdf/partials/notary_signature.html' with name=responses|name_you %}
{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %}
{% include 'pdf/partials/notary_signature.html' with name=responses|name_spouse %}
{% endif %}
{% include 'pdf/partials/fact_sheet_a.html' %}
{% include 'pdf/partials/fact_sheet_b.html' %}


+ 10
- 10
edivorce/apps/core/templates/pdf/form38.html View File

@ -37,11 +37,11 @@
This is the <span class="form-entry-sm not-complete form-underline"></span> affidavit<br>
of
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% required responses.name_you %}
{% required responses|name_you %}
{% endif %}
{% if responses.which_claimant == 'both' %}and<br>{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% required responses.name_spouse %}
{% required responses|name_spouse %}
{% endif %}
in this case,<br>
and was made on <span class="form-entry-md not-complete form-underline"></span>
@ -52,11 +52,11 @@
</p>
<p>
Claimant 1: {% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
Claimant 1: {% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
</p>
<p>
Claimant 2: {% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
Claimant 2: {% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
</p>
<p class="text-center">
@ -66,8 +66,8 @@
<p>
{% if responses.which_claimant == 'both' %}We{% else %}I{% endif %},
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% if responses.name_you %}
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}
{% if responses|name_you %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}
{% else %}<span class="form-entry not-complete"></span>{% endif %},
of
@ -88,8 +88,8 @@
{% if responses.which_claimant == 'both' %}and<br />{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% if responses.name_spouse %}
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}
{% if responses|name_spouse %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}
{% else %}<span class="form-entry not-complete"></span>{% endif %}, of
{% required responses.address_to_send_official_document_street_spouse trail=',' %}
@ -241,10 +241,10 @@
</ol>
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_you %}
{% include 'pdf/partials/notary_signature.html' with name=responses|name_you %}
{% endif %}
{% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %}
{% include 'pdf/partials/notary_signature.html' with name=responses|name_spouse %}
{% endif %}
<small class="bottom">Printed on {% now "F jS, Y" %} from https://justice.gov.bc.ca/divorce</small>


+ 6
- 6
edivorce/apps/core/templates/pdf/form52.html View File

@ -38,11 +38,11 @@
</p>
<p style="max-height: 32px">
<span class="claimant-label">Claimant 1:</span>
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
</p>
<p style="max-height: 32px">
<span class="claimant-label">Claimant 2:</span>
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
</p>
<h2 class="text-center">
FINAL ORDER
@ -67,9 +67,9 @@
<p>THIS COURT ORDERS that</p>
<p>
Subject to section 12 of the <em>Divorce Act</em> (Canada), claimant 1,
{% if responses.name_you %}{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}{% else %}<span class="form-entry not-complete"></span>{% endif %},
{% if responses|name_you %}{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}{% else %}<span class="form-entry not-complete"></span>{% endif %},
and claimant 2,
{% if responses.name_spouse %}{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}{% else %}<span class="form-entry not-complete"></span>{% endif %},
{% if responses|name_spouse %}{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}{% else %}<span class="form-entry not-complete"></span>{% endif %},
who were married at
{% if responses.where_were_you_married_city and responses.where_were_you_married_country %}
{% required responses.where_were_you_married_city %},
@ -167,14 +167,14 @@
<td class="sig-col4 sig-line-text">
<p class="small-margin">Signature of Claimant 1</p>
<p>
<strong>{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}</strong>
<strong>{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you %}</strong>
</p>
</td>
<td class="sig-col1">&nbsp;</td>
<td class="sig-col4 sig-line-text">
<p class="small-margin">Signature of Claimant 2</p>
<p>
<strong>{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}</strong>
<strong>{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse %}</strong>
</p>
</td>
</tr>


+ 10
- 10
edivorce/apps/core/templates/pdf/form96.html View File

@ -35,16 +35,16 @@
<p>
<span class="claimant-label">Claimant 1:</span>
{% if responses.name_you %}
{% include "partials/name_with_alias.html" with name=responses.name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% if responses|name_you %}
{% include "partials/name_with_alias.html" with name=responses|name_you use_other_name=responses.any_other_name_you other_names=responses.other_name_you class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}
</p>
<p>
<span class="claimant-label">Claimant 2:</span>
{% if responses.name_spouse %}
{% include "partials/name_with_alias.html" with name=responses.name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% if responses|name_spouse %}
{% include "partials/name_with_alias.html" with name=responses|name_spouse use_other_name=responses.any_other_name_spouse other_names=responses.other_name_spouse class_name='form-entry_claimant' %}
{% else %}
<span class="form-entry not-complete">&nbsp;</span>
{% endif %}
@ -59,18 +59,18 @@
<span class="form-entry not-complete form-underline">&nbsp;</span>, am the
lawyer acting for {{ responses.which_claimant }},
{% if responses.which_claimant == 'Claimant 1' %}
{% required responses.name_you %}.
{% required responses|name_you %}.
{% endif %}
{% if responses.which_claimant == 'Claimant 2' %}
{% required responses.name_spouse %}.
{% required responses|name_spouse %}.
{% endif %}
</p>
<p class="schIndent1">{% checkbox False %}  I,
{% if responses.which_claimant == 'Claimant 1' %}
{% required responses.name_you %},
{% required responses|name_you %},
{% endif %}
{% if responses.which_claimant == 'Claimant 2' %}
{% required responses.name_spouse %},
{% required responses|name_spouse %},
{% endif %}
am {{ responses.which_claimant }} and I am not represented by a lawyer.</p>
<p>
@ -82,10 +82,10 @@
is being submitted for filing electronically on behalf of
{{ responses.which_claimant }},
{% if responses.which_claimant == 'Claimant 1' %}
{% required responses.name_you %}.
{% required responses|name_you %}.
{% endif %}
{% if responses.which_claimant == 'Claimant 2' %}
{% required responses.name_spouse %}.
{% required responses|name_spouse %}.
{% endif %}
</li>
<li>


+ 5
- 8
edivorce/apps/core/templates/prequalification/step_03.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% block title %}{{ block.super }}: Prequalification{% endblock %}
@ -126,24 +127,20 @@
<div class="question-well">
<h3>
Did {% if name_you %}{{ name_you }}{% else %}you{% endif %}
and {% if name_spouse %}{{ name_spouse }}{% else %}your spouse{% endif %}
attempt to reconcile after you separated
Did you and {% spouse_name %} attempt to reconcile after you separated
<span id="separation_date_span">{% if separation_date %} on {{ separation_date }}{% endif %}</span>?
</h3>
<div class="radio">
<label>
{% input_field type="radio" name="try_reconcile_after_separated" value="NO" data_target_id="reconciliation_period" data_reveal_target="false" %}
No, {% if name_spouse %}{{ name_spouse }}{% else %}my spouse{% endif %}
and I have not reconciled (gotten back together)
No, {% spouse_name if_blank="my spouse" %} and I have not reconciled (gotten back together)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" name="try_reconcile_after_separated" value="YES" data_target_id="reconciliation_period" data_reveal_target="true" %}
Yes, {% if name_spouse %}{{ name_spouse }}{% else %}my spouse{% endif %}
and I lived together again during the following period(s) in an
unsuccessful attempt to reconcile
Yes, {% spouse_name if_blank="my spouse" %} and I lived together again during the following
period(s) in an unsuccessful attempt to reconcile
</label>
</div>


+ 11
- 4
edivorce/apps/core/templates/question/02_claimant.html View File

@ -10,11 +10,18 @@
<h1><small>Step 2:</small>Your Information (Claimant 1)</h1>
<div class="question-well {% if name_you_error %}error{% endif %}">
<div class="question-well {% if last_name_you_error or first_name_you_error %}error{% endif %}">
<h3>Please enter your name (as it appears on your marriage certificate or registration of marriage)
{% if name_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<span class="form-group">
{% input_field type="text" name="name_you" class="form-block input-wide response-textbox name" %}
{% if last_name_you_error or first_name_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<span class="form-group name">
<p>Last name</p>
{% input_field type="text" name="last_name_you" class="form-block input-medium response-textbox name" %}
<p>First name</p>
{% input_field type="text" name="given_name_1_you" class="form-block input-medium response-textbox name" %}
<p>Middle name <span class="optional inline">If applicable</span></p>
{% input_field type="text" name="given_name_2_you" class="form-block input-medium response-textbox name" %}
<p>Middle name #2 <span class="optional inline">If applicable</span></p>
{% input_field type="text" name="given_name_3_you" class="form-block input-medium response-textbox name" %}
</span>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_changed_name" aria-controls="collapse_changed_name">


+ 11
- 4
edivorce/apps/core/templates/question/03_respondent.html View File

@ -13,11 +13,18 @@
<h2>Your Spouse's Information</h2>
<div class="question-well {% if name_spouse_error %}error{% endif %}">
<div class="question-well {% if last_name_spouse_error or first_name_spouse_error %}error{% endif %}">
<h3>What is your spouse's name ( enter name as it appears on the marriage certificate or registration of marriage)?
{% if name_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<span class="form-group">
{% input_field type="text" name="name_spouse" class="form-block input-wide response-textbox name" %}
{% if last_name_spouse_error or first_name_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<span class="form-group name">
<p>Last name</p>
{% input_field type="text" name="last_name_spouse" class="form-block input-medium response-textbox name" %}
<p>First name</p>
{% input_field type="text" name="given_name_1_spouse" class="form-block input-medium response-textbox name" %}
<p>Middle name <span class="optional inline">If applicable</span></p>
{% input_field type="text" name="given_name_2_spouse" class="form-block input-medium response-textbox name" %}
<p>Middle name #2 <span class="optional inline">If applicable</span></p>
{% input_field type="text" name="given_name_3_spouse" class="form-block input-medium response-textbox name" %}
</span>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_legal_name" aria-controls="collapse_legal_name">


+ 4
- 3
edivorce/apps/core/templates/question/04_marriage.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% block title %}{{ block.super }}: Your Marriage{% endblock %}
@ -42,7 +43,7 @@
</div>
<div id="lived_together" class="question-well {% if when_were_you_live_married_like_error %}error{% endif %}">
<h3>When did you and {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %} begin to live together in a marriage-like relationship?
<h3>When did you and {% spouse_name %} begin to live together in a marriage-like relationship?
{% if when_were_you_live_married_like_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
<span class="input-group date date-picker-group">
@ -100,7 +101,7 @@
</div>
<div class="question-well {% if marital_status_before_you_error %}error{% endif %}">
<h3>Before you got married to {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %}, what was your marital status?
<h3>Before you got married to {% spouse_name %}, what was your marital status?
{% if marital_status_before_you_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_you" value="Never married" %}Never married</label></div>
@ -109,7 +110,7 @@
</div>
<div class="question-well {% if marital_status_before_spouse_error %}error{% endif %}">
<h3>What was the marital status of {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %} before your marriage?
<h3>What was the marital status of {% spouse_name %} before your marriage?
{% if marital_status_before_spouse_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_spouse" value="Never married" %}Never married</label></div>


+ 2
- 1
edivorce/apps/core/templates/question/05_separation.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% block title %}{{ block.super }}: Reason For Divorce{% endblock %}
@ -31,7 +32,7 @@
<div class="question-well {% if no_collusion_error %}error{% endif %}">
<p>
We are legally required to ask whether or not you and {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %}
We are legally required to ask whether or not you and {% spouse_name %}
have agreed to deceive the court. This is called “<span class="tooltip-link" data-toggle="tooltip" data-placement="right" data-html="true"
title="<b>Collusion</b><br /><br />Basically this statement confirms that you and your spouse haven’t lied or tried to deceive the court
in any way (for example, saying that you’ve been separated for longer than you have been). It is a legal requirement that you confirm you


+ 8
- 8
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -25,8 +25,8 @@
<div class="question-well {% if child_support_payor_error %}error{% endif %}" id="who_is_payor">
{% money_input_field name="annual_gross_income" hidden="true" %}
{% money_input_field name="spouse_annual_gross_income" hidden="true" %}
<span id="__name_you" hidden>{{ name_you }}</span>
<span id="__name_spouse" hidden>{{ name_spouse }}</span>
<span id="__name_you" hidden>{% you_name if_blank="You" %}</span>
<span id="__name_spouse" hidden>{% spouse_name if_blank="Your spouse" %}</span>
<h3>Who is the
<span class="tooltip-link"
@ -52,33 +52,33 @@
{% if derived.show_fact_sheet_b or derived.show_fact_sheet_c %}
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Myself (Claimant 1)" disabled="" %} {% if name_you %}{{ name_you }} {% else %} Myself {% endif %}(Claimant 1)
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Myself (Claimant 1)" disabled="" %} {% you_name if_blank="Myself" %} (Claimant 1)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="My Spouse (Claimant 2)" disabled="" %} {% if name_spouse %}{{ name_spouse }} {% else %} My spouse {% endif %} (Claimant 2)
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="My Spouse (Claimant 2)" disabled="" %} {% spouse_name if_blank="My spouse" %} (Claimant 2)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Both myself and my spouse" disabled="" %} Both {% if name_you %}{{ name_you }} {% else %} myself {% endif %} and {% if name_spouse %}{{ name_spouse }} {% else %} my spouse {% endif %}
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Both myself and my spouse" disabled="" %} Both {% you_name if_blank="myself" %} and {% spouse_name if_blank="my spouse" %}
</label>
</div>
{% else %}
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Myself (Claimant 1)" %} {% if name_you %}{{ name_you }} {% else %} Myself {% endif %}(Claimant 1)
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Myself (Claimant 1)" %} {% you_name if_blank="Myself" %} (Claimant 1)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="My Spouse (Claimant 2)" %} {% if name_spouse %}{{ name_spouse }} {% else %} My spouse {% endif %} (Claimant 2)
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="My Spouse (Claimant 2)" %} {% spouse_name if_blank="My spouse" %} (Claimant 2)
</label>
</div>
<div class="radio">
<label>
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Both myself and my spouse" %} Both {% if name_you %}{{ name_you }} {% else %} myself {% endif %} and {% if name_spouse %}{{ name_spouse }} {% else %} my spouse {% endif %}
{% input_field type="radio" name="child_support_payor" autocomplete="off" value="Both myself and my spouse" %} Both {% you_name if_blank="myself" %} and {% spouse_name if_blank="my spouse" %}
</label>
</div>
{% endif %}


+ 3
- 2
edivorce/apps/core/templates/question/06_children_payor_medical.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% block title %}{{ block.super }}: Your Children {% endblock %}
@ -10,8 +11,8 @@
<h1><small>Step {% step_order step="children" %}:</small>Children - Medical & other expenses</h1>
<div id="__claimant_names" hidden>
<input name="name_you" value="{{ name_you }}" title="name_you" hidden />
<input name="name_spouse" value="{{ name_spouse }}" title="name_spouse" hidden />
<input name="name_you" value="{% you_name if_blank='You' %}" title="name_you" hidden />
<input name="name_spouse" value="{% spouse_name if_blank='Your spouse' %}" title="name_spouse" hidden />
<input name="claimant_children" value="{{ claimant_children }}" title="claimant_children" hidden />
</div>


+ 4
- 5
edivorce/apps/core/templates/question/06_children_your_children.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% load load_json %}
@ -124,23 +125,21 @@
<div class="radio">
<label class="tight-spacing">
{% input_field type="radio" class="radio-with-other children-input-block" name="child_live_with" value="Lives with you" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
{% if name_you %}{{ name_you }}{% else %}You{% endif %}
{% you_name if_blank="You" %}
</label>
<p>Child lives primarily (more than 60%) with this parent. This is referred to as sole custody (Divorce Act) or guardianship (Family Law Act).</p>
</div>
<div class="radio">
<label class="tight-spacing">
{% input_field type="radio" class="radio-with-other children-input-block" name="child_live_with" value="Lives with spouse" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
{% if name_spouse %}{{ name_spouse }}{% else %}Your spouse{% endif %}
{% spouse_name if_blank="Your spouse" %}
</label>
<p>Child lives primarily (more than 60%) with this parent. This is referred to as sole custody.</p>
</div>
<div class="radio">
<label class="tight-spacing">
{% input_field type="radio" class="radio-with-other children-input-block" name="child_live_with" value="Lives with both" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
Both parents -
{% if name_you %}{{ name_you }}{% else %}you{% endif %} and
{% if name_spouse %}{{ name_spouse }}{% else %}your spouse{% endif %}
Both parents - {% you_name %} and {% spouse_name %}
</label>
<p>
The child lives with both parents more or less equally (between 40-60% of the time with each parent).


+ 5
- 4
edivorce/apps/core/templates/question/07_support.html View File

@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load static %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% block title %}{{ block.super }}: Declarations{% endblock %}
@ -13,8 +14,8 @@
<div class="question-well {% if spouse_support_details_error %}error{% endif %}">
<h3>
{% if name_you %}{{ name_you }}{% else %}Claimant 1{% endif %}
and {% if name_spouse %}{{ name_spouse }}{% else %}Claimant 2{% endif %}
{% you_name if_blank="Claimant 1" %} and
{% spouse_name if_blank="Claimant 2" %}
are asking for an
<span class="tooltip-link" data-toggle="tooltip" data-placement="auto" data-html="true" data-trigger="click"
title="
@ -231,8 +232,8 @@
<h1 class="modal-title">Spousal Support</h1>
</div>
<div class="modal-body">
<p>Okay {{ name_you }}, now we need to ask you several
questions about spousal support.</p>
<p>Okay {% you_name if_blank='Claimant 1' %}, now we need to ask
you several questions about spousal support.</p>
<p>Spousal support is paid by one spouse to financially support
the other spouse after separation, under an agreement or order.


+ 8
- 8
edivorce/apps/core/templates/question/08_property.html View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load input_field %}
{% load format_utils %}
{% load step_order %}
{% block title %}{{ block.super }}: Application Location{% endblock %}
@ -59,8 +60,7 @@
</div>
<div class="question-well {% if deal_with_property_debt_error %}error{% endif %}">
<h3>How have you and
{% if name_spouse %}{{ name_spouse }}{% else %}your spouse{% endif %}
<h3>How have you and {% spouse_name %}
agreed to deal with your property and debt?{% if deal_with_property_debt_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio">
@ -166,8 +166,8 @@
</p>
<div>
<label>
{% if name_you %}{{ name_you }}{% else %}Claimant 1{% endif %}
and {% if name_spouse %}{{ name_spouse }}{% else %}Claimant 2{% endif %}
{% you_name if_blank="Claimant 1" %} and
{% spouse_name if_blank="Claimant 2" %}
ask for an order respecting an interest in property or for
compensation instead of an interest in that property, as follows:
</label>
@ -183,10 +183,10 @@
<h1 class="modal-title">Property and Debt</h1>
</div>
<div class="modal-body">
<p>{{ name_you }}, next up let's go over some questions
pertaining to the division of property and debt. The answers
you provide will be used to populate what's called a Draft
Final Order (Form 52). </p>
<p>{% you_name if_blank="Claimant 1" %}, next up let's go over
some questions pertaining to the division of property and debt.
The answers you provide will be used to populate what's called
a Draft Final Order (Form 52). </p>
<p>A draft final order sets out what orders (decisions) you
want the court to make. This will be reviewed by a judge or


+ 40
- 4
edivorce/apps/core/templatetags/format_utils.py View File

@ -138,12 +138,12 @@ def payorize(context):
payor = 'the payor'
child_support_payor = context.get('child_support_payor', None)
if child_support_payor == 'Myself (Claimant 1)':
payor = context.get('name_you', child_support_payor)
payor = you_name(context, child_support_payor)
elif child_support_payor == 'My Spouse (Claimant 2)':
payor = context.get('name_spouse', child_support_payor)
payor = spouse_name(context, child_support_payor)
elif child_support_payor == 'Both myself and my spouse':
payor = '{} and {}'.format(context.get('name_you', 'myself'),
context.get('name_spouse', 'my spouse'))
payor = '{} and {}'.format(you_name(context, 'myself'),
spouse_name(context, 'my spouse'))
return payor
@ -207,3 +207,39 @@ def css_rotate(image):
return 'width: 100%'
else:
return 'height: 26.7cm'
@register.filter
def name_you(responses):
""" Gets and formats given_name_1_you, given_name_2_you, given_name_3_you, last_name_you from responses """
given_name_1 = responses.get('given_name_1_you', '') + ' '
given_name_2 = responses.get('given_name_2_you', '') + ' '
given_name_3 = responses.get('given_name_3_you', '') + ' '
last_name = responses.get('last_name_you', '')
return re.sub(' +', ' ', given_name_1 + given_name_2 + given_name_3 + last_name).strip()
@register.filter
def name_spouse(responses):
""" Gets and formats given_name_1_spouse, given_name_2_spouse, given_name_3_spouse, last_name_spouse from responses """
given_name_1 = responses.get('given_name_1_spouse', '') + ' '
given_name_2 = responses.get('given_name_2_spouse', '') + ' '
given_name_3 = responses.get('given_name_3_spouse', '') + ' '
last_name = responses.get('last_name_spouse', '')
return re.sub(' +', ' ', given_name_1 + given_name_2 + given_name_3 + last_name).strip()
@register.simple_tag(takes_context=True)
def you_name(context, if_blank='you'):
if name_you(context):
return name_you(context)
else:
return if_blank
@register.simple_tag(takes_context=True)
def spouse_name(context, if_blank='your spouse'):
if name_spouse(context):
return name_spouse(context)
else:
return if_blank

+ 5
- 3
edivorce/apps/core/tests/test_step_completeness.py View File

@ -115,7 +115,8 @@ class StepCompletenessTestCase(TestCase):
# Testing required questions
# Missing few required questions
self.create_response('name_you', 'John Doe')
self.create_response('last_name_you', 'Doe')
self.create_response('given_name_1_you', 'John')
self.create_response('last_name_before_married_you', 'Jackson')
self.create_response('birthday_you', '11/11/1111')
self.create_response('occupation_you', 'Plumber')
@ -164,7 +165,8 @@ class StepCompletenessTestCase(TestCase):
# Testing required questions
# Missing few required questions
self.create_response('name_spouse', 'John Doe')
self.create_response('last_name_spouse', 'Doe')
self.create_response('given_name_1_spouse', 'John')
self.create_response('last_name_before_married_spouse', 'Jackson')
self.create_response('birthday_spouse', '11/11/1111')
self.create_response('occupation_spouse', 'Electrician')
@ -202,7 +204,7 @@ class StepCompletenessTestCase(TestCase):
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='name_spouse').update(value="")
UserResponse.objects.filter(question_id='last_name_spouse').update(value="")
self.assertEqual(self.check_completeness(step), False)
# Put empty response


+ 5
- 4
edivorce/apps/core/utils/derived.py View File

@ -14,6 +14,7 @@ under the _derived_ key.
import json
from edivorce.apps.core.utils import conditional_logic
from edivorce.apps.core.templatetags import format_utils
# This array is order sensitive: later functions may depend on values from
# earlier ones
@ -401,12 +402,12 @@ def child_support_payor_by_name(responses, derived):
payor = 'the payor'
support_payor = child_support_payor(responses, derived)
if support_payor == 'Claimant 1':
payor = responses.get('name_you', support_payor)
payor = format_utils.you_name(responses, support_payor)
elif support_payor == 'Claimant 2':
payor = responses.get('name_spouse', support_payor)
payor = format_utils.spouse_name(responses, child_support_payor)
elif support_payor == 'both Claimant 1 and Claimant 2':
payor = '{} and {}'.format(responses.get('name_you', 'myself'),
responses.get('name_spouse', 'my spouse'))
payor = '{} and {}'.format(format_utils.you_name(responses, 'myself'),
format_utils.spouse_name(responses, 'my spouse'))
return payor


+ 8
- 2
edivorce/apps/core/utils/question_step_mapping.py View File

@ -146,7 +146,10 @@ question_step_mapping = {
'marriage_certificate_in_english',
'divorce_reason'],
'which_orders': ['want_which_orders'],
'your_information': ['name_you',
'your_information': ['last_name_you',
'given_name_1_you',
'given_name_2_you',
'given_name_3_you',
'any_other_name_you',
'other_name_you',
'last_name_born_you',
@ -155,7 +158,10 @@ question_step_mapping = {
'occupation_you',
'lived_in_bc_you',
'moved_to_bc_date_you',],
'your_spouse': ['name_spouse',
'your_spouse': ['last_name_spouse',
'given_name_1_spouse',
'given_name_2_spouse',
'given_name_3_spouse',
'any_other_name_spouse',
'other_name_spouse',
'last_name_born_spouse',


+ 212
- 152
edivorce/fixtures/Question.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save