Browse Source

DIV-1179: Fix a bunch of forms

pull/172/head
ariannedee 5 years ago
parent
commit
07ae174c58
6 changed files with 57 additions and 48 deletions
  1. +36
    -33
      edivorce/apps/core/templates/pdf/form1.html
  2. +2
    -2
      edivorce/apps/core/templates/pdf/form37.html
  3. +1
    -1
      edivorce/apps/core/templates/pdf/form38.html
  4. +2
    -2
      edivorce/apps/core/templates/pdf/form52.html
  5. +1
    -7
      edivorce/apps/core/templates/question/06_children_what_for.html
  6. +15
    -3
      edivorce/apps/core/templatetags/format_utils.py

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

@ -364,7 +364,7 @@
<td>
<strong>Children:</strong>
<br><br>
<span class="td-list-item">{% checkbox children_of_marriage='NO' %}</span>
<span class="td-list-item">{% checkbox has_children_of_marriage='False' %}</span>
<div class="td-list-text">
There are no children of the marriage, as defined by
the <em>Divorce Act</em> (Canada), or children of whom
@ -372,7 +372,7 @@
of the <em>Family Law Act</em>.
</div>
<br><strong>OR</strong><br><br>
<span class="td-list-item">{% checkbox children_of_marriage='YES' %}</span>
<span class="td-list-item">{% checkbox derived.has_children_of_marriage %}</span>
<div class="td-list-text">
There are children of the marriage, as defined by the
<em>Divorce Act</em> (Canada), or children of whom
@ -385,8 +385,8 @@
<th align="center">Full name</th>
<th align="center">Birth date<br />[<em>dd/mmm/yyyy</em>]</th>
<th align="center">Resides with</th>
</tr
{% if responses.children_of_marriage == 'YES' %}
</tr>
{% if derived.has_children_of_marriage %}
{% for child in responses.children %}
<tr>
<td align="center">{{ child.child_name }}</td>
@ -418,14 +418,14 @@
<tr>
<td colname="c2">
<span class="td-list-item">
A. {% checkbox want_parenting_arrangements='YES' children_of_marriage='YES' want_which_orders='Child support' %}
A. {% checkbox derived.has_children_of_marriage derived.wants_child_support want_parenting_arrangements='YES' %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for the following
order respecting arrangements for parenting or
contact:
<span class="form-entry form-textarea not-complete form-list-textarea">
{% if responses.children_of_marriage == 'YES' and responses.want_parenting_arrangements == 'YES' and responses.order_respecting_arrangement and 'Child support' in responses.want_which_orders %}
{% if derived.has_children_of_marriage and responses.want_parenting_arrangements == 'YES' and responses.order_respecting_arrangement and derived.wants_child_support %}
<ul>{{ responses.order_respecting_arrangement|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -435,18 +435,18 @@
<tr>
<td colname="c2">
<span class="td-list-item">
B.
B.
{% if responses.child_support_in_order == 'NO' %}
{% checkbox false %}
{% else %}
{% checkbox responses.order_for_child_support children_of_marriage='YES' want_which_orders='Child support' %}
{% checkbox responses.order_for_child_support derived.has_children_of_marriage derived.wants_child_support %}
{% endif %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order for
child support as follows:
<span class="form-entry form-textarea not-complete form-list-textarea">
{% if responses.children_of_marriage == 'YES' and responses.order_for_child_support and 'Child support' in responses.want_which_orders and responses.child_support_in_order != 'NO' %}
{% if derived.has_children_of_marriage and responses.order_for_child_support and derived.wants_child_support and responses.child_support_in_order != 'NO' %}
<ul>{{ responses.order_for_child_support|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -456,12 +456,12 @@
<tr>
<td colname="c2">
<span class="td-list-item">
C. {% checkbox responses.describe_order_special_extra_expenses children_of_marriage='YES' want_which_orders='Child support' special_extraordinary_expenses='YES' %}
C. {% checkbox derived.wants_child_support derived.has_children_of_marriage special_extraordinary_expenses='YES' %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order for Special and Extraordinary Expenses as follows:<br>
<span class="form-entry form-textarea not-complete form-list-textarea">
{% if responses.children_of_marriage == 'YES' and responses.special_extraordinary_expenses == 'YES' and 'Child support' in responses.want_which_orders %}
{% if derived.has_children_of_marriage and responses.special_extraordinary_expenses == 'YES' and derived.wants_child_support %}
<ul>{{ responses.describe_order_special_extra_expenses|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -472,7 +472,7 @@
<tr>
<td colname="c2">
<span class="td-list-item">
D. {% checkbox responses.child_support_act children_of_marriage='YES' want_which_orders='Child support' %}
D. {% checkbox responses.child_support_act derived.has_children_of_marriage derived.wants_child_support %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for the orders
@ -480,10 +480,10 @@
following statute(s):<br>
[<em>Check one or both of the following boxes, as
applicable.</em>]<br><br>
{% checkbox child_support_act='the Divorce Act (Canada)' children_of_marriage='YES' want_which_orders='Child support' %}
{% checkbox derived.has_children_of_marriage derived.wants_child_support child_support_act='the Divorce Act (Canada)' %}
the <em>Divorce Act</em> (Canada)
&nbsp;&nbsp;&nbsp;&nbsp;
{% checkbox child_support_act='the Family Law Act' children_of_marriage='YES' want_which_orders='Child support' %}
{% checkbox derived.has_children_of_marriage derived.wants_child_support child_support_act='the Family Law Act' %}
the <em>Family Law Act</em>
</div>
</td>
@ -496,11 +496,11 @@
<tbody>
<tr>
<td colname="c2">
<span class="td-list-item">{% checkbox want_which_orders='Spousal support' %}</span>
<span class="td-list-item">{% checkbox derived.wants_spousal_support %}</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order for spousal support as follows:<br>
<span class="form-entry form-textarea not-complete">
{% if 'Spousal support' in responses.want_which_orders and responses.spouse_support_details %}
{% if derived.wants_spousal_support and responses.spouse_support_details %}
<ul>{{responses.spouse_support_details|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -510,16 +510,16 @@
<tr>
<td colname="c2">
<span class="td-list-item">
{% checkbox responses.spouse_support_act want_which_orders='Spousal support' %}
{% checkbox responses.spouse_support_act derived.wants_spousal_support %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order for spousal support under:<br>
[<em>Check one or both of the following boxes, as applicable.</em>]
<br><br>
{% checkbox want_which_orders='Spousal support' spouse_support_act='The Divorce Act (Canada)' %}
{% checkbox derived.wants_spousal_support spouse_support_act='The Divorce Act (Canada)' %}
the <em> Divorce Act </em> (Canada)
&nbsp;&nbsp;&nbsp;&nbsp;
{% checkbox want_which_orders='Spousal support' spouse_support_act='The Family Law Act' %}
{% checkbox derived.wants_spousal_support spouse_support_act='The Family Law Act' %}
the <em> Family Law Act </em>
</div>
@ -535,13 +535,13 @@
<td>
<div><strong>A. Property claims under the <em>Family Law Act</em></strong><br><br></div>
<span class="td-list-item">
{% checkbox want_which_orders='Division of property and debts' %}
{% checkbox derived.wants_property_division %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order for:<br><br>
<div>
<span class="td-list-item">
{% checkbox want_which_orders='Division of property and debts' deal_with_property_debt='Equal division' %}
{% checkbox derived.wants_property_division deal_with_property_debt='Equal division' %}
</span>
<div class="td-list-text">
an equal division of family property and family debt<br><br>
@ -549,12 +549,12 @@
</div>
<div>
<span class="td-list-item">
{% checkbox want_which_orders='Division of property and debts' deal_with_property_debt='Unequal division' %}
{% checkbox derived.wants_property_division deal_with_property_debt='Unequal division' %}
</span>
<div class="td-list-text">
an unequal division of family property and family debt as follows:
<span class="form-entry form-textarea not-complete">
{% if responses.deal_with_property_debt == 'Unequal division' and responses.how_to_divide_property_debt and 'Division of property and debts' in responses.want_which_orders %}
{% if derived.wants_property_division and responses.deal_with_property_debt == 'Unequal division' and responses.how_to_divide_property_debt %}
<ul>{{ responses.how_to_divide_property_debt|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -566,13 +566,13 @@
<tr>
<td>
<div><strong>B. Other property claims</strong><br><br></div>
<span class="td-list-item">{% checkbox responses.other_property_claims %}</span>
<span class="td-list-item">{% checkbox derived.wants_property_division responses.other_property_claims %}</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 ask for an order respecting
an interest in property or for compensation instead
of an interest in that property, as follows:<br>
<span class="form-entry form-textarea not-complete">
{% if responses.other_property_claims %}
{% if derived.wants_property_division and responses.other_property_claims %}
<ul>{{ responses.other_property_claims|striptags|linebreaksli }}</ul>
{% endif %}
</span>
@ -586,14 +586,17 @@
<table class="table table-bordered table-fixed">
<tbody>
<tr>
{% check_list source=responses.want_which_orders value='Other orders' as order_wanted %}
<td>
<span class="td-list-item">
{% if order_wanted and responses.other_orders_detail or responses.name_change_you == 'YES' or responses.name_change_spouse == 'YES' %}
{% checkbox %}
{% else %}
{% if derived.wants_other_orders %}
{% if responses.other_orders_detail or responses.name_change_you == 'YES' or responses.name_change_spouse == 'YES' %}
{% checkbox %}
{% else %}
{% checkbox False %}
{% endif %}
{% else %}
{% checkbox False %}
{% endif %}
{% endif %}
</span>
<div class="td-list-text">
Claimant 1 and Claimant 2 are asking for an order in the
@ -601,11 +604,11 @@
<span class="form-entry form-textarea not-complete">
<ul>
{% if responses.other_orders_detail and order_wanted %}
{% if derived.wants_other_orders and responses.other_orders_detail %}
{{ responses.other_orders_detail|striptags|linebreaksli }}
{% endif %}
{% if responses.name_change_you == 'YES' %}
{% if derived.wants_other_orders and responses.name_change_you == 'YES' %}
<li>
Pursuant to Section 5 of the Name Act, Claimant 1 shall
bear the name of {{ responses.name_change_you_fullname }}
@ -613,7 +616,7 @@
</li>
{% endif %}
{% if responses.name_change_spouse == 'YES' %}
{% if derived.wants_other_orders and responses.name_change_spouse == 'YES' %}
<li>
Pursuant to Section 5 of the Name Act, Claimant 2 shall
bear the name of {{ responses.name_change_spouse_fullname }}


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

@ -278,9 +278,9 @@
out in the proposed order for the expenses under section 7 of the
Guidelines is
{{ derived.total_section_seven_expenses|money }}.
Claimant 1's proportionate share is
Claimant 1's proportionate share is
{{ derived.claimant_1_share|money }}.
Claimant 2's proportionate share is
Claimant 2's proportionate share is
{{ derived.claimant_2_share|money }}.
{% endif %}
</li>


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

@ -174,7 +174,7 @@
</li>
<li>
{% if responses.children_of_marriage == 'YES' %}
{% if derived.has_children_of_marriage %}
<p>
There are children of the marriage as defined by
{{ derived.child_support_acts }}, and


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

@ -110,7 +110,7 @@
</li>
{% endif %}
{% if responses.children_of_marriage == 'YES' and derived.wants_child_support %}
{% if derived.has_children_of_marriage and derived.wants_child_support %}
{% for order in derived.pursuant_parenting_arrangement %}
<li>{{ order }}</li>
{% endfor %}
@ -121,7 +121,7 @@
{% endif %}
{% endif %}
{% if responses.children_of_marriage == 'YES' and responses.special_extraordinary_expenses == 'YES' %}
{% if derived.has_children_of_marriage and responses.special_extraordinary_expenses == 'YES' %}
{{ responses.describe_order_special_extra_expenses|striptags|linebreaksli }}
{% endif %}


+ 1
- 7
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -367,7 +367,7 @@
</blockquote>
{% input_field type="textarea" name="order_respecting_arrangement" class="response-textarea form-control" maxlength="20000" rows="7"%}
</div>
{% if 'Child support' in want_which_orders|load_json %}
{% if derived.wants_child_support %}
<div class="question-well {% if order_for_child_support_error %}error{% endif %}" id="child_support_description">
<h3>If you are asking for an
<span class="tooltip-link"
@ -469,13 +469,9 @@
</p>
</div>
</div>
</div>
{% endblock content %}
{% block formBack %}{% prev_step step='children' sub_step='what_for' %}{% endblock %}
{% block formNext %}{% next_step step='children' sub_step='what_for' %}{% endblock %}
@ -530,6 +526,4 @@
<li>where the children are going to live, and </li>
<li>how much time the children will spend with each parent who is a guardian.</li>
</ul>
{% endblock %}

+ 15
- 3
edivorce/apps/core/templatetags/format_utils.py View File

@ -81,8 +81,16 @@ def checkbox(context, *args, **kwargs):
pass a False value as an argument.
"""
args_pass = all(args)
kwargs_pass = all([value in context['responses'].get(question, '')
for question, value in kwargs.items()])
kwargs_list = []
for question, value in kwargs.items():
if question in context['responses']:
dict_with_question = context['responses']
elif question in context['derived']:
dict_with_question = context['derived']
else:
raise KeyError(f'{question} not found in responses or derived')
kwargs_list.append(str(value) in str(dict_with_question[question]))
kwargs_pass = all(kwargs_list)
return mark_safe('<i class="fa fa%s-square-o" aria-hidden="true"></i>' %
('-check' if args_pass and kwargs_pass else ''))
@ -130,7 +138,11 @@ def money(amount, symbol=True):
except ValueError:
pass
return ''
try:
amount = float(amount)
return '{:.2f}'.format(amount)
except ValueError:
return amount
@register.simple_tag(takes_context=True)


Loading…
Cancel
Save