diff --git a/edivorce/apps/core/templates/pdf/form1.html b/edivorce/apps/core/templates/pdf/form1.html index d4a55193..1b4cdcf0 100644 --- a/edivorce/apps/core/templates/pdf/form1.html +++ b/edivorce/apps/core/templates/pdf/form1.html @@ -1,4 +1,5 @@ {% load static %} +{% load composites %} {% load input_field %} {% load format_utils %} @@ -301,7 +302,7 @@ {% check_list source=responses.want_which_orders value='Spousal support' as order_wanted %} Claimant 1 and Claimant 2 are asking for an order for spousal support as follows: - {% if order_wanted and responses.spouse_support_details %} {{responses.spouse_support_details|striptags|linebreaksul }} {% else %}   {% endif %} + {% if order_wanted and responses.spouse_support_details %}{% else %}   {% endif %} @@ -329,7 +330,7 @@ an unequal division of family property and family debt as follows: - {% 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 %} {% endif %} + {% if responses.deal_with_property_debt == 'Unequal division' and responses.how_to_divide_property_debt and order_wanted %}{% else %} {% endif %} @@ -337,7 +338,7 @@ 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: - {% if responses.other_property_claims %} {{ responses.other_property_claims|striptags|linebreaksul }} {% else %} {% endif %} + {% if responses.other_property_claims %} {% else %} {% endif %} @@ -347,7 +348,36 @@ {% check_list source=responses.want_which_orders value='Other orders' as order_wanted %} - Claimant 1 and Claimant 2 are asking for an order in the following terms: {% if responses.other_orders_detail and order_wanted %} {{ responses.other_orders_detail|striptags|linebreaksul }} {% else %}   {% endif %} + + + Claimant 1 and Claimant 2 are asking for an order in the + following terms: + + + +

[set out terms of proposed order]

@@ -404,6 +434,8 @@

Claimant 1 lawyer for Claimant 1 + jj:q +

diff --git a/edivorce/apps/core/templatetags/format_utils.py b/edivorce/apps/core/templatetags/format_utils.py index 8cfdf856..3fc56349 100644 --- a/edivorce/apps/core/templatetags/format_utils.py +++ b/edivorce/apps/core/templatetags/format_utils.py @@ -7,12 +7,12 @@ register = template.Library() @register.filter -def linebreaksul(value): - "Converts strings with newlines into s" +def linebreaksli(value): + "Converts strings with newlines into
  • s" value = re.sub(r'\r\n|\r|\n', '\n', value.strip()) # normalize newlines lines = re.split('\n', value) lines = ['
  • %s
  • ' % line for line in lines if line and not line.isspace()] - return mark_safe('' % '\n'.join(lines)) + return mark_safe('\n'.join(lines)) @register.filter