Browse Source

Merge branch 'master' into master

pull/160/head
Arianne 5 years ago
committed by GitHub
parent
commit
09c723d0bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 246 additions and 174 deletions
  1. +27
    -2
      edivorce/apps/core/models.py
  2. +2
    -2
      edivorce/apps/core/static/css/main.css
  3. +43
    -8
      edivorce/apps/core/static/css/main.scss
  4. +0
    -0
      edivorce/apps/core/static/fonts/MyriadPro-Bold.otf
  5. +8
    -8
      edivorce/apps/core/static/js/main.js
  6. +1
    -0
      edivorce/apps/core/templates/partials/optional.html
  7. +1
    -0
      edivorce/apps/core/templates/partials/required.html
  8. +16
    -14
      edivorce/apps/core/templates/question/02_claimant.html
  9. +20
    -17
      edivorce/apps/core/templates/question/03_respondent.html
  10. +18
    -13
      edivorce/apps/core/templates/question/04_marriage.html
  11. +11
    -3
      edivorce/apps/core/templates/question/05_separation.html
  12. +5
    -4
      edivorce/apps/core/templates/question/07_support.html
  13. +6
    -5
      edivorce/apps/core/templates/question/08_property.html
  14. +7
    -7
      edivorce/apps/core/templates/question/09_other_orders.html
  15. +20
    -18
      edivorce/apps/core/templates/question/10_other_questions.html
  16. +15
    -43
      edivorce/apps/core/tests.py
  17. +13
    -0
      edivorce/apps/core/utils/question_step_mapping.py
  18. +17
    -4
      edivorce/apps/core/utils/user_response.py
  19. +9
    -5
      edivorce/apps/core/views/main.py
  20. +7
    -21
      edivorce/fixtures/Question.json

+ 27
- 2
edivorce/apps/core/models.py View File

@ -109,6 +109,31 @@ class UserResponse(models.Model):
return '%s -> %s' % (self.bceid_user, self.question.key)
class DontLog:
def log_addition(self, *args):
return
def log_change(self, *args):
return
def log_deletion(self, *args):
return
class UserResponseAdmin(DontLog, admin.ModelAdmin):
list_display = ['get_user_name', 'question', 'value']
def get_user_name(self, obj):
return obj.bceid_user.display_name
get_user_name.admin_order_field = 'bceid_user'
get_user_name.short_description = 'User'
class QuestionAdmin(DontLog, admin.ModelAdmin):
pass
admin.site.register(BceidUser)
admin.site.register(Question)
admin.site.register(UserResponse)
admin.site.register(Question, QuestionAdmin)
admin.site.register(UserResponse, UserResponseAdmin)

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


+ 43
- 8
edivorce/apps/core/static/css/main.scss View File

@ -18,8 +18,10 @@ $color-grey-lightest: #fdfdfd;
$color-green: #57b26a;
$color-green-light: #d9f6df;
$color-gold-light: #e6ca85;
$color-red: #D8292F;
$font-custom: Myriad-Pro, Calibri, Arial, Sans Serif;
$font-custom-bold: Myriad-Pro-Bold, Calibri, Arial, Sans Serif;
@font-face {
font-family: 'Myriad-Pro';
@ -28,6 +30,13 @@ $font-custom: Myriad-Pro, Calibri, Arial, Sans Serif;
font-style: normal;
}
@font-face {
font-family: 'Myriad-Pro-Bold';
src: url('../fonts/MyriadPro-Bold.otf');
font-weight: bold;
font-style: normal;
}
body {
font-family: $font-custom;
font-size: 16px;
@ -669,6 +678,18 @@ i.fa.fa-question-circle {
}
}
.error {
border: 2px solid $color-red !important;
-webkit-transition: 0.1s ease-in-out all;
transition: 0.1s ease-in-out all;
.warning {
color: $color-red;
font-size: 16px;
font-weight: bolder;
}
}
.btn-radio {
color: $brand-titles;
background-color: $color-blue-lighter;
@ -1067,12 +1088,6 @@ textarea {
transition: 0.1s ease-in-out all;
}
&.hasError {
border: 1px solid #FF4136;
-webkit-transition: 0.1s ease-in-out all;
transition: 0.1s ease-in-out all;
}
h3 {
margin-top: 0;
}
@ -1085,6 +1100,26 @@ textarea {
.fact-sheet-table-inline-question {
margin-bottom: 48px;
}
.required, .optional {
font-size: 14px;
font-family: $font-custom-bold;
font-weight: bold;
text-transform: uppercase;
padding: 4px 6px;
margin-left: 16px;
white-space: nowrap;
}
.required {
color: $color-red;
border: $color-red 2px solid;
}
.optional {
color: $color-blue-dark;
border: $color-blue-dark 1px solid;
}
}
.question-well-border-less {
@ -1807,12 +1842,12 @@ textarea {
}
.has-warning-box {
border: 3px solid #a94442;
border: 3px solid $color-red;
padding-top: 8px;
padding-left: 8px;
#terms_warning {
color: #a94442;
color: $color-red;
}
}
/* Modals */


+ 0
- 0
edivorce/apps/core/static/fonts/MyriadPro-Bold.otf View File


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

@ -488,15 +488,15 @@ $(function () {
};
var scrollToFirstError = function() {
var hasErrors = $('.hasError');
var hasErrors = $('.error');
if (hasErrors.length > 0) {
$('.hasError')[0].scrollIntoView();
$('.error')[0].scrollIntoView();
}
};
var clearQuestionWellError = function() {
$('.children-questions .question-well').each(function () {
$(this).removeClass('hasError');
$(this).removeClass('error');
});
};
@ -506,28 +506,28 @@ $(function () {
$('.children-questions .question-well').each(function () {
var questionWell = $(this);
questionWell.removeClass('hasError');
questionWell.removeClass('error');
questionWell.find('input').each(function (index, inputField) {
if (inputField.type === 'text') {
if (inputField.value === '') {
isNotEmpty = false;
questionWell.addClass('hasError');
questionWell.addClass('error');
} else if (inputField.id === 'childs_birth_date') {
if (!moment(inputField.value, "MMM D, YYYY").isValid()) {
isNotEmpty = false;
questionWell.addClass('hasError');
questionWell.addClass('error');
}
} else if (inputField.id === 'childs_name') {
// check for digits in the name
if (hasDigit.test(inputField.value)) {
isNotEmpty = false;
questionWell.addClass('hasError');
questionWell.addClass('error');
}
}
} else if (inputField.type === 'radio') {
if (questionWell.find('input:radio:checked').length === 0) {
isNotEmpty = false;
questionWell.addClass('hasError');
questionWell.addClass('error');
}
return false;
}


+ 1
- 0
edivorce/apps/core/templates/partials/optional.html View File

@ -0,0 +1 @@
<span class="optional">Optional</span>

+ 1
- 0
edivorce/apps/core/templates/partials/required.html View File

@ -0,0 +1 @@
<span class="required">* Required</span>

+ 16
- 14
edivorce/apps/core/templates/question/02_claimant.html View File

@ -10,8 +10,9 @@
<h1><small>Step 2:</small>Your Information (Claimant 1)</h1>
<div class="question-well">
<h3>Please enter your name (as it appears on your marriage certificate or registration of marriage)</h3>
<div class="question-well {% if 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" %}
</span>
@ -40,8 +41,8 @@
</div>
</div>
<div class="question-well">
<h3>Do you go by any other names?</h3>
<div class="question-well {% if any_other_name_you_error %}error{% endif %}">
<h3>Do you go by any other names?{% if any_other_name_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -73,7 +74,7 @@
</div>
<div id="enter_name" hidden>
<h3>Please enter the name</h3>
<h3>Please enter the name{% if other_name_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<!-- This is used for adding a new other name field when add button is clicked -->
<div id="other_names_group" hidden>
{% include "partials/alias_field.html" with name="other_name_you" %}
@ -94,7 +95,7 @@
</div>
<div class="question-well">
<h3>What was your last name when you were born?</h3>
<h3>What was your last name when you were born?{% include 'partials/optional.html' %}</h3>
<span class="form-group">
<div>{% input_field type="text" name="last_name_born_you" class="form-block input-wide response-textbox name" %}</div>
</span>
@ -102,15 +103,15 @@
</div>
<div class="question-well">
<h3>What was your last name immediately before you were married?</h3>
<h3>What was your last name immediately before you were married?{% include 'partials/optional.html' %}</h3>
<span class="form-group">
{% input_field type="text" name="last_name_before_married_you" class="form-block input-wide response-textbox name" %}
</span>
<p>This is often referred to as Family name or Surname</p>
</div>
<div class="question-well">
<h3>What is your date of birth?</h3>
<div class="question-well {% if birthday_you_error %}error{% endif %}">
<h3>What is your date of birth?{% if birthday_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
<span class="input-group date date-picker-group">
{% input_field type="text" name="birthday_you" class="date-picker form-control" id="birth_date" placeholder="MMM D, YYYY" %}
@ -121,17 +122,18 @@
</p>
</div>
<div class="question-well">
<h3>What is your occupation?</h3>
<div class="question-well {% if occupation_you_error %}error{% endif %}">
<h3>What is your occupation?{% if occupation_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div>{% input_field type="text" name="occupation_you" class="form-block input-wide response-textbox" %}</div>
<p>This refers to the type of work you do. For example, janitor, banker, student, nurse etc.</p>
<p>This refers to the type of work you do. For example, janitor, banker, student, nurse etc.</p>
</div>
<div class="question-well">
<h3>How long have you lived in B.C.?</h3>
<div class="question-well {% if lived_in_bc_you_error or moved_to_bc_date_you_error %}error{% endif %}">
<h3>How long have you lived in B.C.?{% if lived_in_bc_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>Please select one</p>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="lived_in_bc_you" value="Since birth" %}Since birth</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="lived_in_bc_you" value="Moved to B.C. on" %}Moved to B.C. on
{% if moved_to_bc_date_you_error %}{% include 'partials/required.html' %}{% endif %}
<span class="input-group date date-picker-group">
{% input_field type="text" name="moved_to_bc_date_you" id="moved_date" class="date-picker other-textbox input-inline form-control" tabindex="-1" placeholder="MMM D, YYYY" %}
<span class="input-group-addon" >


+ 20
- 17
edivorce/apps/core/templates/question/03_respondent.html View File

@ -13,8 +13,9 @@
<h2>Your Spouse's Information</h2>
<div class="question-well">
<h3>What is your spouse's name ( enter name as it appears on the marriage certificate or registration of marriage)?</h3>
<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>
@ -46,8 +47,8 @@
</div>
</div>
<div class="question-well">
<h3>Does your spouse go by any other names?</h3>
<div class="question-well {% if any_other_name_spouse_error %}error{% endif %}">
<h3>Does your spouse go by any other names?{% if any_other_name_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -84,7 +85,7 @@
</div>
<div id="enter_name" hidden>
<h3>Please enter the name</h3>
<h3>Please enter the name{% if other_name_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<!-- This is used for adding a new other name field when add button is clicked -->
<div id="other_names_group" hidden>
{% include "partials/alias_field.html" with name="other_name_spouse" value=' ' delete_button="true" %}
@ -106,7 +107,7 @@
</div>
<div class="question-well">
<h3>What was their last name when they were born?</h3>
<h3>What was their last name when they were born?{% include "partials/optional.html" %}</h3>
<span class="form-group">
{% input_field type="text" name="last_name_born_spouse" class="form-block input-wide response-textbox name" %}
</span>
@ -114,15 +115,15 @@
</div>
<div class="question-well">
<h3>What was their last name immediately before you were married?</h3>
<h3>What was their last name immediately before you were married?{% include "partials/optional.html" %}</h3>
<span class="form-group">
{% input_field type="text" name="last_name_before_married_spouse" class="form-block input-wide response-textbox name" %}
</span>
<p>This is often referred to as Family name or Surname</p>
</div>
<div class="question-well">
<h3>What is your spouse's date of birth?</h3>
<div class="question-well {% if birthday_spouse_error %}error{% endif %}">
<h3>What is your spouse's date of birth?{% if birthday_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
<span class="input-group date date-picker-group">
{% input_field type="text" name="birthday_spouse" class="date-picker form-control" id="birth_date" placeholder="MMM D, YYYY" %}
@ -133,23 +134,25 @@
</p>
</div>
<div class="question-well">
<h3>What is your spouse's occupation?</h3>
<div class="question-well {% if occupation_spouse_error %}error{% endif %}">
<h3>What is your spouse's occupation?{% if occupation_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div>{% input_field type="text" name="occupation_spouse" class="form-block input-wide response-textbox" %}</div>
<p>This refers to the type of work you do. For example, janitor, banker, student, nurse etc.</p>
<p>This refers to the type of work you do. For example, janitor, banker, student, nurse etc.</p>
</div>
<div class="question-well">
<h3>How long has your spouse lived in B.C.?</h3>
<div class="question-well {% if lived_in_bc_spouse_error or moved_to_bc_date_spouse_error %}error{% endif %}">
<h3>How long has your spouse lived in B.C.?{% if lived_in_bc_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>Please select one</p>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="lived_in_bc_spouse" value="Since birth" %}Since birth</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="lived_in_bc_spouse" value="Moved to B.C. on" %}Moved to B.C. on
<div class="radio"><label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="lived_in_bc_spouse" value="Moved to B.C. on" %}Moved to B.C. on{% if moved_to_bc_date_spouse_error %}
{% include 'partials/required.html' %}{% endif %}
<span class="input-group date date-picker-group">
{% input_field type="text" name="moved_to_bc_date_spouse" id="moved_date" class="date-picker other-textbox input-inline form-control" tabindex="-1" placeholder="MMM D, YYYY" %}
{% input_field type="text" name="moved_to_bc_date_spouse" id="moved_date" class="date-picker other-textbox input-inline form-control" tabindex="-1" placeholder="MMM D, YYYY" required="lived_in_bc_spouse=Moved to B.C. on"%}
<span class="input-group-addon" >
<i class="fa fa-calendar circle"></i>
</span>
</span></label></div>
</span>
</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="lived_in_bc_spouse" value="Does not live in B.C." %}Does not live in B.C.</label></div>
<p>In order to apply for a divorce in B.C., you or your spouse must have been a regular resident in B.C (the legal term is ordinarily resident


+ 18
- 13
edivorce/apps/core/templates/question/04_marriage.html View File

@ -30,8 +30,8 @@
your divorce request being returned for correction.</p>
{% if married_marriage_like == 'Legally married' %}
<div id="when_married" class="question-well">
<h3>When were you married?</h3>
<div id="when_married" class="question-well {% if when_were_you_married_error %}error{% endif %}">
<h3>When were you married?{% if when_were_you_married_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
<span class="input-group date date-picker-group">
{% input_field type="text" name="when_were_you_married" class="date-picker form-control" id="marriage_date" placeholder="MMM D, YYYY" %}
@ -43,8 +43,9 @@
</div>
{% endif %}
<div id="lived_together" class="question-well">
<h3>When did you and {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %} begin to live together in a marriage-like relationship?</h3>
<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?
{% if when_were_you_live_married_like_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
<span class="input-group date date-picker-group">
{% input_field type="text" name="when_were_you_live_married_like" class="date-picker form-control" id="lived_start_date" placeholder="MMM D, YYYY" %}
@ -88,14 +89,14 @@
{% if married_marriage_like == 'Legally married' %}
<div class="question-well">
<div class="question-well {% if where_were_you_married_city_error or where_were_you_married_country_error or where_were_you_married_other_country_error %}error{% endif %}">
<h3>Where were you married?</h3>
<p>Enter the location as it appears on the marriage certificate (e.g. city, province or state and country)</p>
<p>City</p>
<p>City{% if where_were_you_married_city_error %}{% include 'partials/required.html' %}{% endif %}</p>
{% input_field type="text" name="where_were_you_married_city" class="form-block input-wide response-textbox" %}
<p>Prov/State (optional)</p>
<p>Prov/State{% include "partials/optional.html" %}</p>
{% input_field type="text" name="where_were_you_married_prov" class="form-block input-narrow response-textbox" %}
<p>Country</p>
<p>Country{% if where_were_you_married_country_error or where_were_you_married_other_country_error %}{% include 'partials/required.html' %}{% endif %}</p>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="where_were_you_married_country" value="Canada" %}Canada</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="where_were_you_married_country" value="USA" %}USA</label></div>
@ -103,15 +104,19 @@
</div>
{% endif %}
<div class="question-well">
<h3>Before you got married to {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %}, what was your marital status?</h3>
<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?
{% 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>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_you" value="Divorced" %}Divorced</label></div>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_you" value="Widowed" %}Widowed</label></div>
</div>
<div class="question-well">
<h3>What was the marital status of {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %} before your marriage?</h3>
<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?
{% 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>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_spouse" value="Divorced" %}Divorced</label></div>
<div class="radio"><label>{% input_field type="radio" name="marital_status_before_spouse" value="Widowed" %}Widowed</label></div>
@ -123,7 +128,7 @@
<div class="modal-content">
<div class="modal-header">
<i class="fa fa-link" aria-hidden="true"></i>
<h1 class="modal-title">Your Marriage</h1>
<h1 class="modal-title">Your Marriage</h1>
</div>
<div class="modal-body">
<p>Now we’d like to learn about the details of your marriage history. Make sure you have a copy of your marriage certificate. You will need this to provide us with the exact date of your marriage.</p>


+ 11
- 3
edivorce/apps/core/templates/question/05_separation.html View File

@ -10,12 +10,16 @@
<h1><small>Step 5:</small>Your Separation</h1>
<div class="question-well">
<h3>There is no possibility my spouse and I will get back together (reconciliation).</h3>
<div class="question-well {% if no_reconciliation_possible_error %}error{% endif %}">
<h3>There is no possibility my spouse and I will get back together (reconciliation).
{% if no_reconciliation_possible_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<p>
For this question, we need to confirm that there is no chance you and your spouse will be getting back together.
By selecting "I agree" this shows the court that you and your spouse have thoroughly thought out your request for divorce.
</p>
{% if no_reconciliation_possible_error %}<div class="warning"><p>* In order to process your application, you must agree to this condition. If you can not agree,
please consult a lawyer.</p></div>{% endif %}
<div class="checkbox-group">
<div class="checkbox">
<label>
@ -25,7 +29,7 @@
</div>
</div>
<div class="question-well">
<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 %}
have agreed to deceive the court. This is called “<span class="tooltip-link" data-toggle="tooltip" data-placement="right" data-html="true"
@ -33,7 +37,11 @@
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
are providing accurate and complete information.">collusion<i class="fa fa-question-circle" aria-hidden="true"></i></span>
”. An example of collusion is when a couple agrees to lie about the date of separation to speed up the divorce process.
{% if no_collusion_error %}{% include 'partials/required.html' %}{% endif %}
</p>
{% if no_collusion_error %}
<div class="warning"><p>* In order to process your application, you must agree to this condition. If you can not agree,
please consult a lawyer.</p></div>{% endif %}
<div class="checkbox-group">
<div class="checkbox">
<label>


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

@ -11,7 +11,7 @@
<h1><small>Step 6:</small>Spousal Support</h1>
<div class="question-well">
<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 %}
@ -22,7 +22,7 @@
<p>A type of court ruling a judge or master makes that sets out
what you must do or not do.</p>
">order<i class="fa fa-question-circle" aria-hidden="true"></i></span>
for spousal support as follows:
for spousal support as follows:{% if spouse_support_details_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
{% input_field type="textarea" name="spouse_support_details" rows="8" cols="65" class="response-textarea" placeholder="Please enter the spousal support details that you want to appear in the order issued by the court." %}
<p>
@ -151,9 +151,10 @@
</div>
<div class="question-well">
<div class="question-well {% if spouse_support_act_error %}error{% endif %}">
{% if married_marriage_like == "Legally married" %}
<h3>Please indicate which act you are asking for support under.</h3>
<h3>Please indicate which act you are asking for support under.{% if spouse_support_act_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio">
<label>
{% input_field type="radio" name="spouse_support_act" value="The Divorce Act (Canada)" data_target_id="family_law_time_limit" data_reveal_target="false" %}


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

@ -58,10 +58,11 @@
</p>
</div>
<div class="question-well">
<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 %}
agreed to deal with your property and debt?</h3>
agreed to deal with your property and debt?{% if deal_with_property_debt_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio">
<label>
{% input_field type="radio" name="deal_with_property_debt" value="Equal division" data_target_id="property_debt_division_method" data_reveal_target="false" %}
@ -103,9 +104,9 @@
</div>
<div id="property_debt_division_method" class="question-well" hidden>
<div id="property_debt_division_method" class="question-well {% if how_to_divide_property_debt_error %}error{% endif %}" hidden>
<h3>Please describe how you and your spouse plan to divide your property,
assets and your debts. </h3>
assets and your debts.{% if how_to_divide_property_debt_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>Because the division of family property and debt can be complex we
recommend you get
<a href="http://www2.gov.bc.ca/gov/content/life-events/divorce/family-justice/who-can-help/lawyers"
@ -146,7 +147,7 @@
</div>
<div class="question-well">
<h3>Other Property Claims</h3>
<h3>Other Property Claims{% include 'partials/optional.html' %}</h3>
<p>This section is for property claims not covered by the Family Law
Act—property that is not family property. This includes:</p>
<ul>


+ 7
- 7
edivorce/apps/core/templates/question/09_other_orders.html View File

@ -11,8 +11,8 @@
<h1><small>Step {% step_order step="other_orders" %}:</small>Other Orders</h1>
<div class="question-well">
<h3>Are you asking for a legal name change?</h3>
<div class="question-well {% if name_change_you_error or name_change_you_fullname_error %}error{% endif %}">
<h3>Are you asking for a legal name change?{% if name_change_you_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -42,14 +42,14 @@
</div>
<div id="name_change_you_fullname" hidden>
<h3>Please enter the full <strong>new</strong> name</h3>
<h3>Please enter the full <strong>new</strong> name{% if name_change_you_fullname_error %}{% include 'partials/required.html' %}{% endif %}</h3>
{% input_field type="text" name="name_change_you_fullname" class="form-block input-wide response-textbox" %}
</div>
</div>
<div class="question-well">
<h3>Is your spouse asking for a legal name change?</h3>
<div class="question-well {% if name_change_spouse_error or name_change_spouse_fullname_error %}error{% endif %}">
<h3>Is your spouse asking for a legal name change?{% if name_change_spouse_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -78,14 +78,14 @@
</div>
<div id="name_change_spouse_fullname" hidden>
<h3>Please enter the full <strong>new</strong> name</h3>
<h3>Please enter the full <strong>new</strong> name{% if name_change_spouse_fullname_error %}{% include 'partials/required.html' %}{% endif %}</h3>
{% input_field type="text" name="name_change_spouse_fullname" class="form-block input-wide response-textbox" %}
</div>
</div>
<div class="question-well">
<h3>Please enter the details for other orders that you are asking for.</h3>
<h3>Please enter the details for other orders that you are asking for.{% include 'partials/optional.html' %}</h3>
{% input_field type="textarea" name="other_orders_detail" rows="8" cols="65" class="response-textarea" %}
<div id="questions_modal" class="modal in" tabindex="-1" role="dialog" style="display: block">


+ 20
- 18
edivorce/apps/core/templates/question/10_other_questions.html View File

@ -11,24 +11,24 @@
<h1><small>Step {% step_order step="other_questions" %}:</small>Other Questions</h1>
<div class="question-well">
<div class="question-well {% if address_to_send_official_document_street_you_error or address_to_send_official_document_city_you_error or address_to_send_official_document_country_you_error or address_to_send_official_document_other_country_you_error %}error{% endif %}">
<div>
<h3>What is the best address to send you official court documents?</h3>
<h2>Your Contact Information</h2>
<p>House and street number</p>
<p>House and street number{% if address_to_send_official_document_street_you_error %}{% include 'partials/required.html' %}{% endif %}</p>
{% input_field type="text" name="address_to_send_official_document_street_you" class="form-block input-wide response-textbox" %}
<p>City</p>
<p>City{% if address_to_send_official_document_city_you_error %}{% include 'partials/required.html' %}{% endif %}</p>
{% input_field type="text" name="address_to_send_official_document_city_you" class="form-block input-wide response-textbox" %}
<p>Prov/State (optional)</p>
<p>Prov/State {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_prov_you" class="form-block input-narrow response-textbox" %}
<p>Country</p>
<p>Country{% if address_to_send_official_document_country_you_error or address_to_send_official_document_other_country_you_error %}{% include 'partials/required.html' %}{% endif %}</p>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="address_to_send_official_document_country_you" value="Canada" %}Canada</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="address_to_send_official_document_country_you" value="USA" %}USA</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="address_to_send_official_document_country_you" value="Other" %}Other {% input_field type="text" name="address_to_send_official_document_other_country_you" class="response-textbox other-textbox input-inline" tabindex="-1" %}</label></div>
<p>Postal code (optional)</p>
<p>Postal code {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_postal_code_you" class="form-block input-wide response-textbox" %}
</div>
@ -37,32 +37,33 @@
If your main address is a PO box, you can list this instead of the fax or email but you must also list
an address that’s not a PO box.</p>
<p>Fax number (optional)</p>
<p>Fax number {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_fax_you" class="form-block input-wide response-textbox" %}
<div class="form-group">
<p>Email Address (optional)</p>
<p>Email Address {% include 'partials/optional.html' %}</p>
{% input_field type="text" id="email_textbox" name="address_to_send_official_document_email_you" class="form-block input-wide response-textbox form-control" %}
</div>
</div>
</div>
<div class="question-well">
<div class="question-well {% if address_to_send_official_document_street_spouse_error or address_to_send_official_document_city_spouse_error or address_to_send_official_document_country_spouse_error or address_to_send_official_document_other_country_spouse_error %}error{% endif %}">
<div>
<h2>Your Spouse's Contact Information</h2>
<p>House and street number</p>
<p>House and street number{% if address_to_send_official_document_street_spouse_error %}{% include 'partials/required.html' %}{% endif %}</p>
{% input_field type="text" name="address_to_send_official_document_street_spouse" class="form-block input-wide response-textbox" %}
<p>City</p>
<p>City{% if address_to_send_official_document_city_spouse_error %}{% include 'partials/required.html' %}{% endif %}</p>
{% input_field type="text" name="address_to_send_official_document_city_spouse" class="form-block input-wide response-textbox" %}
<p>Prov/State (optional)</p>
<p>Prov/State {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_prov_spouse" class="form-block input-narrow response-textbox" %}
<p>Country</p>
<p>Country{% if address_to_send_official_document_country_spouse_error or address_to_send_official_document_other_country_spouse_error %}
{% include 'partials/required.html' %}{% endif %}</p>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="address_to_send_official_document_country_spouse" value="Canada" %}Canada</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="address_to_send_official_document_country_spouse" value="USA" %}USA</label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="address_to_send_official_document_country_spouse" value="Other" %}Other {% input_field type="text" name="address_to_send_official_document_other_country_spouse" class="response-textbox other-textbox input-inline" tabindex="-1" %}</label></div>
<p>Postal code (optional)</p>
<p>Postal code {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_postal_code_spouse" class="form-block input-wide response-textbox" %}
</div>
@ -71,21 +72,22 @@
If your spouse's main address is a PO box, your spouse can list this instead of the fax or email but your spouse must also list
an address that’s not a PO box.</p>
<p>Fax number (optional)</p>
<p>Fax number {% include 'partials/optional.html' %}</p>
{% input_field type="text" name="address_to_send_official_document_fax_spouse" class="form-block input-wide response-textbox" %}
<div class="form-group">
<p>Email Address (optional)</p>
<p>Email Address {% include 'partials/optional.html' %}</p>
{% input_field type="text" id="email_textbox" name="address_to_send_official_document_email_spouse" class="form-block input-wide response-textbox form-control" %}
</div>
</div>
</div>
{% if married_marriage_like == "Legally married" %}
<div class="question-well">
<h2>Divorce is to take effect on:</h2>
<div class="question-well {% if divorce_take_effect_on_error or divorce_take_effect_on_specific_date_error %}error{% endif %}">
<h2>Divorce is to take effect on: {% if divorce_take_effect_on_error %}{% include 'partials/required.html' %}{% endif %}</h2>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="divorce_take_effect_on" value="the 31st day after the date of this order" data_target_id="take_effect_alert" data_reveal_target="false" %}the 31st day after the date of this order</label></div>
<div class="radio">
<label>{% input_field type="radio" class="radio-with-other" name="divorce_take_effect_on" value="specific date" data_target_id="take_effect_alert" data_reveal_target="true" %}a specific date
{% if divorce_take_effect_on_specific_date_error %}{% include 'partials/required.html' %}{% endif %}
<span class="input-group date date-picker-group" data-allow-future-date="true">
{% input_field type="text" name="divorce_take_effect_on_specific_date" id="effect_date" class="date-picker-future other-textbox input-inline form-control" tabindex="-1" placeholder="MMM D, YYYY" %}
<span class="input-group-addon" ><i class="fa fa-calendar circle"></i></span>


+ 15
- 43
edivorce/apps/core/tests.py View File

@ -184,11 +184,7 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Test for marriage-like relationship
create_response(user, 'married_marriage_like', 'Living together in a marriage like relationship')
questions.append('married_marriage_like')
# One required question
# Some required questions
create_response(user, 'when_were_you_live_married_like', '12/12/2007')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
@ -197,7 +193,7 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# One required question and one not shown question(shouldn't be affecting)
# Some required questions
create_response(user, 'when_were_you_married', '12/12/2008')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
@ -206,7 +202,7 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Two required question and one not shown question(shouldn't be affecting)
# Some required questions
create_response(user, 'marital_status_before_you', 'Never married')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
@ -215,19 +211,9 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# All required question and one not shown question(shouldn't be affecting)
# Some required questions
create_response(user, 'marital_status_before_spouse', 'Widowed')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# Test for Legally Married state
UserResponse.objects.filter(question_id='married_marriage_like').update(value="Legally married")
# Missing some required questions
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
@ -428,10 +414,6 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Test for marriage-like relationship
create_response(user, 'married_marriage_like', 'Living together in a marriage like relationship')
questions.append('married_marriage_like')
# One required question
create_response(user, 'address_to_send_official_document_street_you', '123 Cambie st')
@ -511,19 +493,10 @@ class UserResponseTestCase(TestCase):
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# All required questions for spouse and you
create_response(user, 'address_to_send_official_document_postal_code_spouse', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(is_complete(step, lst)[0], False)
# All required questions for spouse and you with empty email(optional so still true)
create_response(user, 'address_to_send_official_document_email_you', 'a@example.com')
# All required questions
create_response(user, 'divorce_take_effect_on', 'the 31st day after the date of this order')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
@ -531,10 +504,9 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# Test for Legally Married state
UserResponse.objects.filter(question_id='married_marriage_like').update(value="Legally married")
# Missing conditional required question
UserResponse.objects.filter(question_id='divorce_take_effect_on').update(value="specific date")
# Missing some required questions for legally married state
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
@ -542,7 +514,7 @@ class UserResponseTestCase(TestCase):
self.assertEqual(is_complete(step, lst)[0], False)
# All required questions
create_response(user, 'divorce_take_effect_on', 'the 31st day after the date of this order')
create_response(user, 'divorce_take_effect_on_specific_date', '12/12/2018')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
@ -550,17 +522,17 @@ class UserResponseTestCase(TestCase):
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# Missing required question
UserResponse.objects.filter(question_id='divorce_take_effect_on').update(value="specific date")
# All required questions for spouse and you
create_response(user, 'address_to_send_official_document_postal_code_spouse', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(is_complete(step, lst)[0], True)
# All required questions
create_response(user, 'divorce_take_effect_on_specific_date', '12/12/2018')
# All required questions for spouse and you with empty email(optional so still true)
create_response(user, 'address_to_send_official_document_email_you', 'a@example.com')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',


+ 13
- 0
edivorce/apps/core/utils/question_step_mapping.py View File

@ -174,6 +174,19 @@ question_step_mapping = {
}
page_step_mapping = {
'orders': 'which_orders',
'claimant': 'your_information',
'respondent': 'your_spouse',
'marriage': 'your_marriage',
'separation': 'your_separation',
'support': 'spousal_support',
'property': 'property_and_debt',
'other_orders': 'other_orders',
'other_questions': 'other_questions',
}
""" List of court registries """
list_of_registries = ['Fort St. John', 'Dawson Creek', 'Prince Rupert',
'Terrace', 'Smithers', 'Prince George', 'Quesnel',


+ 17
- 4
edivorce/apps/core/utils/user_response.py View File

@ -4,16 +4,29 @@ from edivorce.apps.core.utils.step_completeness import evaluate_numeric_conditio
from collections import OrderedDict
def get_responses_from_db(bceid_user):
""" Get UserResponses from the database for a user. """
def get_responses_from_db(bceid_user, show_errors=False, step=None, substep=None):
""" Get UserResponses from the database for a user."""
married, married_questions, responses = __get_data(bceid_user)
responses_dict = {}
for answer in responses:
if not married and answer.question_id in married_questions:
responses_dict[answer.question.key] = ''
else:
elif answer.value.strip('[').strip(']'):
responses_dict[answer.question.key] = answer.value
if show_errors:
step_questions = question_step_mapping.get(step, [])
questions = Question.objects.filter(key__in=step_questions)
for question in questions:
if responses_dict.get(question.key):
error = False
elif question.required == 'Required':
error = True
elif question.required == 'Conditional':
conditional_response = UserResponse.objects.filter(question=question.conditional_target).first()
error = conditional_response and conditional_response.value == question.reveal_response
else:
error = False
responses_dict['{}_error'.format(question.key)] = error
return responses_dict


+ 9
- 5
edivorce/apps/core/views/main.py View File

@ -6,7 +6,7 @@ from django.utils import timezone
from edivorce.apps.core.utils.derived import get_derived_data
from ..decorators import bceid_required, intercept
from ..utils.question_step_mapping import list_of_registries
from ..utils.question_step_mapping import list_of_registries, page_step_mapping
from ..utils.step_completeness import get_step_status, is_complete, get_formatted_incomplete_list
from ..utils.template_step_order import template_step_order
from ..utils.user_response import get_responses_from_db, copy_session_to_db, \
@ -188,14 +188,18 @@ def question(request, step, sub_step=None):
template = 'question/%02d_%s%s.html' % (template_step_order[step], step, sub_page_template)
responses_dict_by_step = get_responses_from_db_grouped_by_steps(request.user, True)
step_status = get_step_status(responses_dict_by_step)
if step == "review":
responses_dict = responses_dict_by_step
derived = get_derived_data(get_responses_from_db(request.user))
else:
responses_dict = get_responses_from_db(request.user)
question_step = page_step_mapping.get(step, step)
show_errors = step_status.get(question_step) == 'Started'
responses_dict = get_responses_from_db(request.user, show_errors=show_errors, step=question_step, substep=sub_step)
derived = get_derived_data(responses_dict)
# Add step status dictionary
responses_dict['step_status'] = get_step_status(responses_dict_by_step)
responses_dict['step_status'] = step_status
responses_dict['active_page'] = step
# If page is filing location page, add registries dictionary for list of court registries
@ -203,7 +207,7 @@ def question(request, step, sub_step=None):
responses_dict['registries'] = sorted(list_of_registries)
responses_dict['sub_step'] = sub_step
responses_dict['derived'] = get_derived_data(get_responses_from_db(request.user))
responses_dict['derived'] = derived
return render(request, template_name=template, context=responses_dict)


+ 7
- 21
edivorce/fixtures/Question.json View File

@ -98,9 +98,7 @@
"name": "Will you be able to provide proof of your marriage (in the form of an original or certified marriage certificate or registration of marriage)?",
"description": "For pre-qualification step 5, Form 1 2. Divorce section D, Form 38(joint and sole) question 4",
"summary_order": 10,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "original_marriage_certificate"
@ -158,9 +156,7 @@
"name": "What is your reason (grounds) for asking for a divorce?",
"description": "For pre-qualification step 6",
"summary_order": 15,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "divorce_reason"
@ -369,9 +365,7 @@
"name": "When were you married?",
"description": "For step 4, Form 1 1. Relationship history, Form 52 Court orders that section",
"summary_order": 35,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "when_were_you_married"
@ -391,9 +385,7 @@
"name": "Where were you married?",
"description": "For step 4, Form 1 2. Divorce section A, Form 52 Court orders that section",
"summary_order": 37,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "where_were_you_married_city"
@ -403,9 +395,7 @@
"name": "Where were you married? Prov",
"description": "For step 4, Form 1 2. Divorce section A, Form 52 Court orders that section",
"summary_order": 38,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "where_were_you_married_prov"
@ -415,9 +405,7 @@
"name": "Where were you married? Country",
"description": "For step 4, Form 1 2. Divorce section A, Form 52 Court orders that section",
"summary_order": 39,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "where_were_you_married_country"
@ -708,9 +696,7 @@
"name": "Divorce is to take effect on",
"description": "For step 9, Form 52 This Court Orders that",
"summary_order": 68,
"required": "Conditional",
"conditional_target": "married_marriage_like",
"reveal_response": "Legally married"
"required": "Required"
},
"model": "core.question",
"pk": "divorce_take_effect_on"


Loading…
Cancel
Save