Browse Source

DIV-501

pull/160/head
Justin Johnson 8 years ago
parent
commit
eaf9dbccad
2 changed files with 39 additions and 7 deletions
  1. +36
    -4
      edivorce/apps/core/templates/pdf/form1.html
  2. +3
    -3
      edivorce/apps/core/templatetags/format_utils.py

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

@ -1,4 +1,5 @@
{% load static %} {% load static %}
{% load composites %}
{% load input_field %} {% load input_field %}
{% load format_utils %} {% load format_utils %}
<!doctype html> <!doctype html>
@ -301,7 +302,7 @@
<tr> <tr>
{% check_list source=responses.want_which_orders value='Spousal support' as order_wanted %} {% check_list source=responses.want_which_orders value='Spousal support' as order_wanted %}
<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: <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 order_wanted and responses.spouse_support_details %} {{responses.spouse_support_details|striptags|linebreaksul }} {% else %} &nbsp; {% endif %}</span>
<span class="form-entry form-textarea not-complete">{% if order_wanted and responses.spouse_support_details %}<ul>{{responses.spouse_support_details|striptags|linebreaksli }}</ul>{% else %} &nbsp; {% endif %}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -329,7 +330,7 @@
</tr> </tr>
<tr> <tr>
<td> <i class="fa {% if responses.deal_with_property_debt == 'Unequal division' and order_wanted %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> an unequal division of family property and family debt as follows: <td> <i class="fa {% if responses.deal_with_property_debt == 'Unequal division' and order_wanted %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> 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 order_wanted %} {{ responses.how_to_divide_property_debt|striptags|linebreaksul }} {% else %}&nbsp;{% endif %}</span>
<span class="form-entry form-textarea not-complete">{% if responses.deal_with_property_debt == 'Unequal division' and responses.how_to_divide_property_debt and order_wanted %}<ul>{{ responses.how_to_divide_property_debt|striptags|linebreaksli }}</ul>{% else %}&nbsp;{% endif %}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -337,7 +338,7 @@
</tr> </tr>
<tr> <tr>
<td> <i class="fa {% if responses.other_property_claims %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> 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: <td> <i class="fa {% if responses.other_property_claims %} fa-check-square-o {% else %} fa-square-o{% endif %}" aria-hidden="true"></i> 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:
<span class="form-entry form-textarea not-complete">{% if responses.other_property_claims %} {{ responses.other_property_claims|striptags|linebreaksul }} {% else %}&nbsp;{% endif %}</span> </td>
<span class="form-entry form-textarea not-complete">{% if responses.other_property_claims %} <ul>{{ responses.other_property_claims|striptags|linebreaksli }}</ul> {% else %}&nbsp;{% endif %}</span> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -347,7 +348,36 @@
<tbody> <tbody>
<tr> <tr>
{% check_list source=responses.want_which_orders value='Other orders' as order_wanted %} {% check_list source=responses.want_which_orders value='Other orders' as order_wanted %}
<td> <i class="fa {% if order_wanted and responses.other_orders_detail.trim %} 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">{% if responses.other_orders_detail and order_wanted %} {{ responses.other_orders_detail|striptags|linebreaksul }} {% else %} &nbsp; {% endif %}</span>
<td>
<i class="fa {% if order_wanted and responses.other_orders_detail or responses.name_change_you == 'YES' or responses.name_change_spouse == 'YES' %} 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">
<ul>
{% if responses.other_orders_detail and order_wanted %}
{{ responses.other_orders_detail|striptags|linebreaksli }}
{% endif %}
{% if 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 }}
to take effect on {% effective_date %}.
</li>
{% endif %}
{% if 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 }}
to take effect on {% effective_date %}.
</li>
{% endif %}
</ul>
</span>
<p class="text-center"> <p class="text-center">
[<em>set out terms of proposed order</em>] [<em>set out terms of proposed order</em>]
</p> </p>
@ -404,6 +434,8 @@
</p> </p>
<p> <p>
<i class="fa fa-square-o" aria-hidden="true"></i> Claimant 1 <i class="fa fa-square-o" aria-hidden="true"></i> lawyer for Claimant 1 <i class="fa fa-square-o" aria-hidden="true"></i> Claimant 1 <i class="fa fa-square-o" aria-hidden="true"></i> lawyer for Claimant 1
jj:q
</p> </p>
</td> </td>
</tr> </tr>


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

@ -7,12 +7,12 @@ register = template.Library()
@register.filter @register.filter
def linebreaksul(value):
"Converts strings with newlines into <ul><li></li></ul>s"
def linebreaksli(value):
"Converts strings with newlines into <li></li>s"
value = re.sub(r'\r\n|\r|\n', '\n', value.strip()) # normalize newlines value = re.sub(r'\r\n|\r|\n', '\n', value.strip()) # normalize newlines
lines = re.split('\n', value) lines = re.split('\n', value)
lines = ['<li>%s</li>' % line for line in lines if line and not line.isspace()] lines = ['<li>%s</li>' % line for line in lines if line and not line.isspace()]
return mark_safe('<ul>%s</ul>' % '\n'.join(lines))
return mark_safe('\n'.join(lines))
@register.filter @register.filter


Loading…
Cancel
Save