Browse Source

Merge branch 'master' into DIV-1022

# Conflicts:
#	edivorce/apps/core/static/css/main.css
pull/172/head
ariannedee 5 years ago
parent
commit
260e56a046
33 changed files with 646 additions and 383 deletions
  1. +41
    -0
      edivorce/apps/core/migrations/0023_auto_20201006_1314.py
  2. +1
    -1
      edivorce/apps/core/static/css/main.css
  3. +31
    -0
      edivorce/apps/core/static/css/main.scss
  4. +6
    -4
      edivorce/apps/core/static/js/functions.js
  5. +2
    -2
      edivorce/apps/core/static/js/main.js
  6. +23
    -6
      edivorce/apps/core/templates/partials/alias_field.html
  7. +11
    -1
      edivorce/apps/core/templates/partials/name_with_alias.html
  8. +2
    -2
      edivorce/apps/core/templates/pdf/form1.html
  9. +6
    -6
      edivorce/apps/core/templates/pdf/form35.html
  10. +5
    -4
      edivorce/apps/core/templates/pdf/form36.html
  11. +12
    -12
      edivorce/apps/core/templates/pdf/form37.html
  12. +10
    -10
      edivorce/apps/core/templates/pdf/form38.html
  13. +6
    -6
      edivorce/apps/core/templates/pdf/form52.html
  14. +10
    -10
      edivorce/apps/core/templates/pdf/form96.html
  15. +5
    -8
      edivorce/apps/core/templates/prequalification/step_03.html
  16. +24
    -7
      edivorce/apps/core/templates/question/02_claimant.html
  17. +24
    -8
      edivorce/apps/core/templates/question/03_respondent.html
  18. +4
    -3
      edivorce/apps/core/templates/question/04_marriage.html
  19. +2
    -1
      edivorce/apps/core/templates/question/05_separation.html
  20. +8
    -8
      edivorce/apps/core/templates/question/06_children_facts.html
  21. +3
    -2
      edivorce/apps/core/templates/question/06_children_payor_medical.html
  22. +4
    -5
      edivorce/apps/core/templates/question/06_children_your_children.html
  23. +5
    -4
      edivorce/apps/core/templates/question/07_support.html
  24. +8
    -8
      edivorce/apps/core/templates/question/08_property.html
  25. +42
    -4
      edivorce/apps/core/templatetags/format_utils.py
  26. +12
    -5
      edivorce/apps/core/templatetags/summary_format.py
  27. +9
    -7
      edivorce/apps/core/tests/test_step_completeness.py
  28. +5
    -4
      edivorce/apps/core/utils/derived.py
  29. +8
    -2
      edivorce/apps/core/utils/question_step_mapping.py
  30. +212
    -152
      edivorce/fixtures/Question.json
  31. +2
    -0
      openshift/templates/nginx-proxy/conf.d/server.conf
  32. +98
    -90
      vue/package-lock.json
  33. +5
    -1
      vue/src/components/Uploader/Uploader.vue

+ 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)
]

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


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

@ -615,6 +615,37 @@ select.form-control {
width: 70%;
}
}
.alias-header {
width: 100%;
}
.form-group.name-group {
@media (min-width: 992px) {
display: flex !important;
flex-direction: row;
justify-content: space-between;
margin-top: 20px;
margin-bottom: 8px;
}
> div {
width: 80%;
@media (min-width: 992px) {
width: 24%;
}
input {
width: 99%;
}
}
p {
margin-bottom: 3px;
}
}
/* Buttons & Icons*/
.btn {
line-height: initial;


+ 6
- 4
edivorce/apps/core/static/js/functions.js View File

@ -271,10 +271,12 @@ var getValue = function(el, question){
// for adding other_name fields, create list of [aliasType, alias]
else if (question === "other_name_you" || question === "other_name_spouse"){
var aliasType = "also known as";
$('#other_names_fields').find("input[type=text]").each(function () {
// as per request, alias type will always be also known as for now
// aliasType = $(this).val() === '' ? '' : $(this).siblings(".alias-type").val();
value.push([aliasType, $(this).val().trim()]);
$('#other_names_fields').find('.alias-field-group').each(function () {
var lastName = $(this).find(".alias-last-name").val();
var given1 = $(this).find(".alias-given-1").val();
var given2 = $(this).find(".alias-given-2").val();
var given3 = $(this).find(".alias-given-3").val();
value.push([aliasType, lastName, given1, given2, given3]);
});
return JSON.stringify(value);
}


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

@ -225,7 +225,7 @@ $(function () {
// Add name button adds new input field for adding other name
// Maximum of two other name fields allowed
$("#btn_add_other_names").on('click', function () {
if ($('#other_names_fields input[type=text]').length < 2) {
if ($('#other_names_fields .alias-field-group').length < 2) {
$('#other_names_fields').append($('#other_names_group').children().clone(true));
}
@ -234,7 +234,7 @@ $(function () {
// Show warning text when there are 2 other name fields
var showWarningOtherName = function() {
if ($('#other_names_fields input[type=text]').length >= 2) {
if ($('#other_names_fields .alias-field-group').length >= 2) {
$('#btn_add_other_names').hide();
$('#other_name_warning_message').html("<p>Max 2 other names, please enter only the name variations to be shown on the order from the court</p>");
}


+ 23
- 6
edivorce/apps/core/templates/partials/alias_field.html View File

@ -1,5 +1,5 @@
{% load input_field %}
<div class="form-inline clearfix">
<div class="form-inline clearfix alias-field-group">
{% comment As per request, alias type will fixed to "also know as" %}
<select class="response-dropdown alias-type form-control" name={{name}}>
<option value="also known as" {% if alias_type == 'also known as' %} selected {% endif %}>Also known as</option>
@ -9,10 +9,27 @@
</select>
{% endcomment %}
<label>Also known as</label>
<span class="form-group">
{% input_field type="text" name=name value=value multiple="true" class="form-control response-textbox alias-names" %}
</span>
<div class="alias-header">
<label>Also known as</label>
<input type="button" class="btn btn-danger btn-delete-name form-control pull-right" value="Delete" />
</div>
<div class="form-group name-group alias-body">
<div>
<p>First Name</p>
{% input_field type="text" name=name value=given_1 multiple="true" class="form-block response-textbox alias-given-1" %}
</div>
<div>
<p>Middle Name 1</p>
{% input_field type="text" name=name value=given_2 multiple="true" ignore_error=True class="form-block response-textbox alias-given-2" %}
</div>
<div>
<p>Middle Name 2</p>
{% input_field type="text" name=name value=given_3 multiple="true" ignore_error=True class="form-block response-textbox alias-given-3" %}
</div>
<div>
<p>Last Name</p>
{% input_field type="text" name=name value=last_name multiple="true" class="form-block response-textbox alias-last-name" %}
</div>
</div>
<input type="button" class="btn btn-danger btn-delete-name form-control" value="Delete" />
</div>

+ 11
- 1
edivorce/apps/core/templates/partials/name_with_alias.html View File

@ -1,2 +1,12 @@
{% load input_field %}
<span class="{{class_name}}">{{ name }}{% if other_names and use_other_name == 'YES' %}{% multiple_values_to_list source=other_names as values %}{% for alias_type, value in values %}{% if value != '' %} {{alias_type}} {{value}}{% endif %}{% endfor %}{% endif %}</span>
<span class="{{class_name}}">
{{ name }}
{% if other_names and use_other_name == 'YES' %}
{% multiple_values_to_list source=other_names as values %}
{% for value in values %}
{% if value.1 != '' %}
{{ value.0 }} {{ value.1 }} {{ value.2 }} {{ value.3 }} {{ value.4 }}
{% endif %}
{% endfor %}
{% endif %}
</span>

+ 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>


+ 24
- 7
edivorce/apps/core/templates/question/02_claimant.html View File

@ -10,12 +10,27 @@
<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 given_name_1_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" %}
</span>
{% if last_name_you_error or given_name_1_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="form-group name-group">
<div>
<p>First Name</p>
{% input_field type="text" name="given_name_1_you" class="form-block response-textbox" %}
</div>
<div>
<p>Middle Name 1</p>
{% input_field type="text" name="given_name_2_you" class="form-block response-textbox" %}
</div>
<div>
<p>Middle Name 2</p>
{% input_field type="text" name="given_name_3_you" class="form-block response-textbox" %}
</div>
<div>
<p>Last Name</p>
{% input_field type="text" name="last_name_you" class="form-block response-textbox" %}
</div>
</div>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_changed_name" aria-controls="collapse_changed_name">
<div>
@ -81,9 +96,11 @@
</div>
<div id="other_names_fields">
{% if other_name_you %}
{% if other_name_you %}
{% multiple_values_to_list source=other_name_you as values %}
{% for alias_type, value in values %} {% include "partials/alias_field.html" with name="other_name_you" alias_type=alias_type value=value delete_button="true" %} {% endfor %}
{% for value in values %}
{% include "partials/alias_field.html" with name="other_name_you" alias_type=value.0 last_name=value.1 given_1=value.2 given_2=value.3 given_3=value.4 delete_button="true" %}
{% endfor %}
{% else %}
{% include "partials/alias_field.html" with name="other_name_you" %}
{% endif %}


+ 24
- 8
edivorce/apps/core/templates/question/03_respondent.html View File

@ -13,12 +13,28 @@
<h2>Your Spouse's Information</h2>
<div class="question-well {% if 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" %}
</span>
<div class="question-well {% if last_name_spouse_error or given_name_1_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 last_name_spouse_error or given_name_1_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="form-group name-group">
<div>
<p>First Name</p>
{% input_field type="text" name="given_name_1_spouse" class="form-block response-textbox" %}
</div>
<div>
<p>Middle Name 1</p>
{% input_field type="text" name="given_name_2_spouse" class="form-block response-textbox" %}
</div>
<div>
<p>Middle Name 2</p>
{% input_field type="text" name="given_name_3_spouse" class="form-block response-textbox" %}
</div>
<div>
<p>Last Name</p>
{% input_field type="text" name="last_name_spouse" class="form-block response-textbox" %}
</div>
</div>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_legal_name" aria-controls="collapse_legal_name">
<div>
@ -93,8 +109,8 @@
<div id="other_names_fields">
{% if other_name_spouse %}
{% multiple_values_to_list source=other_name_spouse as values %}
{% for alias_type, value in values %}
{% include "partials/alias_field.html" with name="other_name_spouse" alias_type=alias_type value=value delete_button="true" %}
{% for value in values %}
{% include "partials/alias_field.html" with name="other_name_spouse" alias_type=value.0 last_name=value.1 given_1=value.2 given_2=value.3 given_3=value.4 delete_button="true" %}
{% endfor %}
{% else %}
{% include "partials/alias_field.html" with name="other_name_spouse" value='' %}


+ 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


+ 42
- 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,41 @@ 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')
names = [given_name_1, given_name_2, given_name_3, last_name]
return ' '.join(filter(None, names))
@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')
names = [given_name_1, given_name_2, given_name_3, last_name]
return ' '.join(filter(None, names))
@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

+ 12
- 5
edivorce/apps/core/templatetags/summary_format.py View File

@ -73,11 +73,18 @@ def process_json_list(question_key, json_list):
def get_other_name_tags(json_list):
list_items = format_html_join(
'\n',
'<li>{} {}</li>',
((alias_type, value) for alias_type, value in json_list if value))
return list_items
if len(json_list) > 0 and len(json_list[0]) == 5:
# new json format with fielded names
return format_html_join(
'\n',
'<li>{} {} {} {} {}</li>',
((alias_type, last_name, given1, given2, given3) for alias_type, last_name, given1, given2, given3 in json_list if last_name))
else:
# old json format with unfielded names
return format_html_join(
'\n',
'<li>{} {}</li>',
((alias_type, value) for alias_type, value in json_list if value))
def get_reconciliation_period_tags(json_list):


+ 9
- 7
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')
@ -148,11 +149,11 @@ class StepCompletenessTestCase(TestCase):
self.assertEqual(self.check_completeness(step), False)
# All required questions with all checking question with all hidden questions
self.create_response('other_name_you', '[["also known as","Smith"]]')
self.create_response('other_name_you', '[["also known as","Smith","James","Jerry","Joseph"]]')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='other_name_you').update(value='[["",""]]')
UserResponse.objects.filter(question_id='other_name_you').update(value='[["","","","",""]]')
self.assertEqual(self.check_completeness(step), False)
def test_your_spouse(self):
@ -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')
@ -189,7 +191,7 @@ class StepCompletenessTestCase(TestCase):
self.assertEqual(self.check_completeness(step), False)
# All required questions with two checking question with one hidden and one shown
self.create_response('other_name_spouse', '[["also known as","Smith"]]')
self.create_response('other_name_spouse', '[["also known as","Smith","James","Jerry","Joseph"]]')
self.assertEqual(self.check_completeness(step), True)
self.assertEqual(self.check_step_status(step), Status.COMPLETED)
@ -202,11 +204,11 @@ 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
UserResponse.objects.filter(question_id='other_name_spouse').update(value='[["",""]]')
UserResponse.objects.filter(question_id='other_name_spouse').update(value='[["","","","",""]]')
self.assertEqual(self.check_completeness(step), False)
def test_your_marriage(self):


+ 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


+ 2
- 0
openshift/templates/nginx-proxy/conf.d/server.conf View File

@ -16,6 +16,8 @@ server {
gzip_proxied any;
gzip_vary on;
client_max_body_size 12M;
# default path
location / {
proxy_pass http://edivorce-django:8080;


+ 98
- 90
vue/package-lock.json View File

@ -1307,16 +1307,6 @@
"integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==",
"dev": true
},
"@types/mini-css-extract-plugin": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.1.tgz",
"integrity": "sha512-+mN04Oszdz9tGjUP/c1ReVwJXxSniLd7lF++sv+8dkABxVNthg6uccei+4ssKxRHGoMmPxdn7uBdJWONSJGTGQ==",
"dev": true,
"optional": true,
"requires": {
"@types/webpack": "*"
}
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@ -1697,6 +1687,16 @@
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
@ -1723,6 +1723,34 @@
"unique-filename": "^1.1.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
@ -1744,6 +1772,25 @@
"path-exists": "^4.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@ -1808,6 +1855,16 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
@ -1824,6 +1881,18 @@
"terser": "^4.6.12",
"webpack-sources": "^1.4.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-beta.8",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.8.tgz",
"integrity": "sha512-oouKUQWWHbSihqSD7mhymGPX1OQ4hedzAHyvm8RdyHh6m3oIvoRF+NM45i/bhNOlo8jCnuJhaSUf/6oDjv978g==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@ -2578,6 +2647,16 @@
"dev": true,
"optional": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"block-stream": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
@ -5089,6 +5168,13 @@
"schema-utils": "^2.5.0"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"filesize": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz",
@ -10930,86 +11016,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-beta.5",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.5.tgz",
"integrity": "sha512-ciWfzNefqWlmzKznCWY9hl+fPP4KlQ0A9MtHbJ/8DpyY+dAM8gDrjufIdxwTgC4szE4EZC3A6ip/BbrqM84GqA==",
"dev": true,
"optional": true,
"requires": {
"@types/mini-css-extract-plugin": "^0.9.1",
"chalk": "^3.0.0",
"hash-sum": "^2.0.0",
"loader-utils": "^1.2.3",
"merge-source-map": "^1.1.0",
"source-map": "^0.6.1"
},
"dependencies": {
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"optional": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-style-loader": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",
@ -11129,6 +11135,7 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
@ -11434,6 +11441,7 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},


+ 5
- 1
vue/src/components/Uploader/Uploader.vue View File

@ -194,7 +194,11 @@
const statusCode = newFile.xhr.status;
if (statusCode === 400) {
// 400 validation error: show the message returned by the server
const message = JSON.parse(newFile.xhr.responseText)[0];
let message = newFile.xhr.responseText;
const response = JSON.parse(message);
if (response.file) {
message = response.file[0];
}
this.showError(message);
this.$refs.upload.remove(newFile);
} else if (statusCode === 403) {


Loading…
Cancel
Save