Browse Source

Added date picker and added postal code field

pull/160/head
Charles Shin 8 years ago
parent
commit
9105182b80
16 changed files with 85 additions and 19 deletions
  1. +9
    -0
      edivorce/apps/core/static/css/bootstrap-datepicker3.min.css
  2. +7
    -0
      edivorce/apps/core/static/js/main.js
  3. +9
    -0
      edivorce/apps/core/static/js/vendor/bootstrap-datepicker.min.js
  4. +2
    -0
      edivorce/apps/core/templates/base.html
  5. +8
    -8
      edivorce/apps/core/templates/pdf/form1.html
  6. +1
    -0
      edivorce/apps/core/templates/pdf/form35.html
  7. +1
    -0
      edivorce/apps/core/templates/pdf/form36.html
  8. +1
    -0
      edivorce/apps/core/templates/pdf/form38.html
  9. +1
    -0
      edivorce/apps/core/templates/pdf/form52.html
  10. +1
    -1
      edivorce/apps/core/templates/prequalification/step_03.html
  11. +2
    -2
      edivorce/apps/core/templates/question/02_claimant.html
  12. +2
    -2
      edivorce/apps/core/templates/question/03_respondent.html
  13. +2
    -2
      edivorce/apps/core/templates/question/04_marriage.html
  14. +6
    -0
      edivorce/apps/core/templates/question/10_location.html
  15. +17
    -4
      edivorce/apps/core/utils/question_step_mapping.py
  16. +16
    -0
      edivorce/fixtures/Question.json

+ 9
- 0
edivorce/apps/core/static/css/bootstrap-datepicker3.min.css
File diff suppressed because it is too large
View File


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

@ -19,6 +19,13 @@ $(function () {
$("input[type=radio], input[type=checkbox], input[type=text], .response-textarea, .response-dropdown").on("change", ajaxOnChange);
// Configuration for datepicker
$(".date-picker-group").datepicker({
format: "dd/mm/yyyy",
endDate: "today",
autoclose: true
});
// On step_03.html, update text when user enters separation date
$("#separated_date").on("change", function(){
$("#separation_date_span").text(" on " + $(this).val());


+ 9
- 0
edivorce/apps/core/static/js/vendor/bootstrap-datepicker.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
edivorce/apps/core/templates/base.html View File

@ -11,6 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap-datepicker3.min.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/font-awesome.min.css" %}">
{% load compress %}
{% compress css %}
@ -98,6 +99,7 @@
<script type="text/javascript" src="{% static 'js/vendor/jquery-1.12.4.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/vendor/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/vendor/bootstrap-datepicker.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/controllers.js' %}"></script>
<script type="text/javascript" src="{% static 'js/ajax.js' %}"></script>
<script type="text/javascript" src="{% static 'js/main.js' %}"></script>


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

@ -78,7 +78,7 @@
<tbody>
<tr>
{% check_list source=responses.want_which_orders value='A legal end to the marriage' as order_wanted %}
<td colspan="3"> <i class="fa {% if order_wanted %} icon-check">&#xe800;</i> {% else %} icon-check-empty">&#xf096;</i> {% endif %} Claimant 1 and Claimant 2 are asking for a divorce order. </td>
<td colspan="3"> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for a divorce order. </td>
</tr>
<tr>
<td colspan="3"> <strong> A Personal information: </strong> </td>
@ -294,7 +294,7 @@
<tbody>
<tr>
{% check_list source=responses.want_which_orders value='Spousal support' as order_wanted %}
<td colname="c2"> <i class="fa {% if order_wanted %} icon-check">&#xe800;</i> {% else %} icon-check-empty">&#xf096;</i> {% endif %} Claimant 1 and Claimant 2 are asking for an order for spousal support as follows:
<td colname="c2"> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for an order for spousal support as follows:
<span class="form-entry form-textarea not-complete">{% if responses.spouse_support_details %} {{responses.spouse_support_details }} {% else %} &nbsp; {% endif %}</span>
<p class="text-center">
[<em>set out terms of proposed order</em>]
@ -321,7 +321,7 @@
</tr>
<tr>
{% check_list source=responses.want_which_orders value='Division of property and debts' as order_wanted %}
<td> <i class="fa {% if order_wanted %} icon-check">&#xe800;</i> {% else %} icon-check-empty">&#xf096;</i> {% endif %} Claimant 1 and Claimant 2 are asking for an order for: <br /><em> [Check whichever one of the following boxes is correct and complete any required information in relation to family property and family debt, as those terms are defined in the Family Law Act.] </em> </td>
<td> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for an order for: <br /><em> [Check whichever one of the following boxes is correct and complete any required information in relation to family property and family debt, as those terms are defined in the Family Law Act.] </em> </td>
</tr>
<tr>
<td> <i class="fa {% if responses.deal_with_property_debt == 'equal division' %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} an equal division of family property and family debt </td>
@ -350,7 +350,7 @@
<tbody>
<tr>
{% check_list source=responses.want_which_orders value='Other orders' as order_wanted %}
<td> <i class="fa {% if order_wanted %} icon-check">&#xe800;</i> {% else %} icon-check-empty">&#xf096;</i> {% endif %} Claimant 1 and Claimant 2 are asking for an order in the following terms: <span class="form-entry form-textarea not-complete">&nbsp;</span>
<td> <i class="fa {% if order_wanted %} fa-check-square-o {% else %} fa-square-o {% endif %}" aria-hidden="true"></i> Claimant 1 and Claimant 2 are asking for an order in the following terms: <span class="form-entry form-textarea not-complete">&nbsp;</span>
<p class="text-center">
[<em>set out terms of proposed order</em>]
</p>
@ -367,17 +367,17 @@
<tr>
<td>
<p>Claimant 1:
{% if responses.address_to_send_official_document_street_you and responses.address_to_send_official_document_city_you and responses.address_to_send_official_document_prov_you and responses.address_to_send_official_document_country_you %}
{% if responses.address_to_send_official_document_street_you and responses.address_to_send_official_document_city_you and responses.address_to_send_official_document_prov_you and responses.address_to_send_official_document_country_you and responses.address_to_send_official_document_postal_code_you %}
{{ responses.address_to_send_official_document_street_you }}, {{ responses.address_to_send_official_document_city_you }}, {{ responses.address_to_send_official_document_prov_you }},
{% if responses.address_to_send_official_document_country_you == 'Other' %} {{ responses.address_to_send_official_document_other_country_you }} {% else %} {{ responses.address_to_send_official_document_country_you }} {% endif %} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
{% if responses.address_to_send_official_document_country_you == 'Other' %} {{ responses.address_to_send_official_document_other_country_you }}{% else %} {{ responses.address_to_send_official_document_country_you }}{% endif %}, {{ responses.address_to_send_official_document_postal_code_you }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
<p>Fax (optional) {% if responses.address_to_send_official_document_fax_you %} {{ responses.address_to_send_official_document_fax_you }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
<p>E-mail (optional) {% if responses.address_to_send_official_document_email_you %} {{ responses.address_to_send_official_document_email_you }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
</td>
<td colname="c2">
<p>Claimant 2:
{% if responses.address_to_send_official_document_street_spouse and responses.address_to_send_official_document_city_spouse and responses.address_to_send_official_document_prov_spouse and responses.address_to_send_official_document_country_spouse %}
{% if responses.address_to_send_official_document_street_spouse and responses.address_to_send_official_document_city_spouse and responses.address_to_send_official_document_prov_spouse and responses.address_to_send_official_document_country_spouse and responses.address_to_send_official_document_postal_code_spouse %}
{{ responses.address_to_send_official_document_street_spouse }}, {{ responses.address_to_send_official_document_city_spouse }}, {{ responses.address_to_send_official_document_prov_spouse }},
{% if responses.address_to_send_official_document_country_spouse == 'Other' %} {{ responses.address_to_send_official_document_other_country_spouse }} {% else %} {{ responses.address_to_send_official_document_country_spouse }} {% endif %} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
{% if responses.address_to_send_official_document_country_spouse == 'Other' %} {{ responses.address_to_send_official_document_other_country_spouse }}{% else %} {{ responses.address_to_send_official_document_country_spouse }}{% endif %}, {{ responses.address_to_send_official_document_postal_code_spouse }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
<p>Fax (optional) {% if responses.address_to_send_official_document_fax_spouse %} {{ responses.address_to_send_official_document_fax_spouse }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
<p>E-mail (optional) {% if responses.address_to_send_official_document_email_spouse %} {{ responses.address_to_send_official_document_email_spouse }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </p>
</td>


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

@ -12,6 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/bootstrap-slim.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/weasyprint.css" />
</head>


+ 1
- 0
edivorce/apps/core/templates/pdf/form36.html View File

@ -12,6 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/bootstrap-slim.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/weasyprint.css" />
</head>


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

@ -12,6 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/bootstrap-slim.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/weasyprint.css" />
</head>


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

@ -12,6 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/bootstrap-slim.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{{ css_root }}/static/css/weasyprint.css" />
</head>


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

@ -16,7 +16,7 @@
have clearly communicated your intention for a permanent separation (and are starting to act upon it).</p>
<p>This could mean:</p><ul><li>You're living in separate rooms</li><li>You're sleeping in separate beds</li><li>There's no sexual relationship</li>" aria-hidden="true"></i>?
</h3>
<p>{% input_field type="text" name="separation_date" class="date-picker" id="separated_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></p>
<p><span class="date-picker-group">{% input_field type="text" name="separation_date" class="date-picker" id="separated_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_determine_separation_date" aria-controls="collapse_determine_separation_date">
<div>


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

@ -106,14 +106,14 @@
<div class="col-md-8 col-md-offset-2">
<div>
<h3>When is your birthday?</h3>
<p>{% input_field type="text" name="birthday_you" class="date-picker" id="birth_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></p>
<p><span class="date-picker-group">{% input_field type="text" name="birthday_you" class="date-picker" id="birth_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></p>
</div>
<div>
<h3>How long have you lived in British Columbia?</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 British Columbia on" %}Moved to British Columbia on {% input_field type="text" name="moved_to_bc_date_you" id="moved_date" class="date-picker other-textbox input-inline" tabindex="-1" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></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 British Columbia on" %}Moved to British Columbia on <span class="date-picker-group">{% input_field type="text" name="moved_to_bc_date_you" id="moved_date" class="date-picker-group date-picker other-textbox input-inline" tabindex="-1" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="lived_in_bc_you" value="Do not live in British Columbia" %}Do not live in British Columbia</label></div>
<p>In order to apply for a divorce in British Columbia, you or your spouse must have been a regular resident in B.C (the legal term is ordinarily resident


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

@ -108,14 +108,14 @@
<div class="col-md-8 col-md-offset-2">
<div>
<h3>When is your spouse's birthday?</h3>
<p>{% input_field type="text" name="birthday_spouse" class="date-picker" id="birth_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></p>
<p><span class="date-picker-group">{% input_field type="text" name="birthday_spouse" class="date-picker" id="birth_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></p>
</div>
<div>
<h3>How long has your spouse lived in British Columbia?</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 British Columbia on" %}Moved to British Columbia on {% input_field type="text" name="moved_to_bc_date_spouse" id="moved_date" class="date-picker other-textbox input-inline" tabindex="-1" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></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 British Columbia on" %}Moved to British Columbia on <span class="date-picker-group">{% input_field type="text" name="moved_to_bc_date_spouse" id="moved_date" class="date-picker other-textbox input-inline" tabindex="-1" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></label></div>
<div class="radio"><label>{% input_field type="radio" class="radio-with-other" name="lived_in_bc_spouse" value="Do not live in British Columbia" %}Do not live in British Columbia</label></div>
<p>In order to apply for a divorce in British Columbia, you or your spouse must have been a regular resident in B.C (the legal term is ordinarily resident


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

@ -31,12 +31,12 @@
<div id="when_married">
<h3>When were you married?</h3>
<p>{% input_field type="text" name="when_were_you_married" class="date-picker" id="marriage_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></p>
<p><span class="date-picker-group">{% input_field type="text" name="when_were_you_married" class="date-picker" id="marriage_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></p>
</div>
<div id="lived_together">
<h3>When did you and {% if name_spouse %} {{ name_spouse }} {% else %} your spouse {% endif %} begin to live together in a marriage-like relationship?</h3>
<p>{% input_field type="text" name="when_were_you_live_married_like" class="date-picker" id="lived_start_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></p>
<p><span class="date-picker-group">{% input_field type="text" name="when_were_you_live_married_like" class="date-picker" id="lived_start_date" placeholder="DD/MM/YYYY" %} <i class="fa fa-calendar circle" aria-hidden="true"></i></span></p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_start_date" aria-controls="collapse_start_date">
<div>


+ 6
- 0
edivorce/apps/core/templates/question/10_location.html View File

@ -44,6 +44,9 @@
<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><em>Postal code</em></p>
{% input_field type="text" name="address_to_send_official_document_postal_code_you" class="form-block input-wide response-textbox" %}
</div>
<div>
@ -74,6 +77,9 @@
<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><em>Postal code</em></p>
{% input_field type="text" name="address_to_send_official_document_postal_code_spouse" class="form-block input-wide response-textbox" %}
</div>
<div>


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

@ -19,8 +19,21 @@ question_step_mapping = {'prequalification': ['married_marriage_like', 'lived_in
'property_and_debt': ['deal_with_property_debt', 'how_to_divide_property_debt', 'other_property_claims',],
'other_orders': [],
'other_questions': [],
'filing_locations': ['address_to_send_official_document_street', 'address_to_send_official_document_city',
'address_to_send_official_document_prov', 'address_to_send_official_document_country',
'address_to_send_official_document_other_country', 'address_to_send_official_document_fax',
'address_to_send_official_document_email', 'court_registry_for_filing',],
'filing_locations': ['court_registry_for_filing',
'address_to_send_official_document_street_you',
'address_to_send_official_document_city_you',
'address_to_send_official_document_prov_you',
'address_to_send_official_document_country_you',
'address_to_send_official_document_other_country_you',
'address_to_send_official_document_postal_code_you',
'address_to_send_official_document_fax_you',
'address_to_send_official_document_email_you',
'address_to_send_official_document_street_spouse',
'address_to_send_official_document_city_spouse',
'address_to_send_official_document_prov_spouse',
'address_to_send_official_document_country_spouse',
'address_to_send_official_document_other_country_spouse',
'address_to_send_official_document_postal_code_spouse',
'address_to_send_official_document_fax_spouse',
'address_to_send_official_document_email_spouse',],
}

+ 16
- 0
edivorce/fixtures/Question.json View File

@ -415,6 +415,14 @@
"model": "core.question",
"pk": "address_to_send_official_document_other_country_you"
},
{
"fields": {
"name": "What is the best address to send you official court documents? Postal code",
"description": "For step 10, Form 1 8. Claimants' addresses for service"
},
"model": "core.question",
"pk": "address_to_send_official_document_postal_code_you"
},
{
"fields": {
"name": "What is the best address to send you official court documents? Fax number",
@ -471,6 +479,14 @@
"model": "core.question",
"pk": "address_to_send_official_document_other_country_spouse"
},
{
"fields": {
"name": "What is the best address to send your spouse official court documents? Postal code",
"description": "For step 10, Form 1 8. Claimants' addresses for service"
},
"model": "core.question",
"pk": "address_to_send_official_document_postal_code_spouse"
},
{
"fields": {
"name": "What is the best address to send your spouse official court documents? Fax number",


Loading…
Cancel
Save