Browse Source

DIV-354 - Change carriage returns to bullet lists on display for Spousal Support, Property and Debt and Other Orders

pull/160/head
Mike Olund 8 years ago
parent
commit
4a2ef5e4a6
3 changed files with 20 additions and 5 deletions
  1. +1
    -1
      edivorce/apps/core/templates/dashboard/print_form.html
  2. +5
    -4
      edivorce/apps/core/templates/pdf/form1.html
  3. +14
    -0
      edivorce/apps/core/templatetags/format_utils.py

+ 1
- 1
edivorce/apps/core/templates/dashboard/print_form.html View File

@ -89,7 +89,7 @@
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapseF38" aria-controls="collapseF38"> <div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapseF38" aria-controls="collapseF38">
<div> <div>
Affidavit Desk Order Divorce Form (F38)) - signing together
Affidavit Desk Order Divorce Form (F38) - signing together
</div> </div>
<p><a href="{% url 'pdf_form' '38_we' %}?html" target="_blank">Preview</a> | <a href="{% url 'pdf_form' '38_we' %}" class="spinner">Print</a></p> <p><a href="{% url 'pdf_form' '38_we' %}?html" target="_blank">Preview</a> | <a href="{% url 'pdf_form' '38_we' %}" class="spinner">Print</a></p>
</div> </div>


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

@ -1,5 +1,6 @@
{% load static %} {% load static %}
{% load input_field %} {% load input_field %}
{% load format_utils %}
<!doctype html> <!doctype html>
<html class="no-js" lang="en"> <html class="no-js" lang="en">
@ -297,7 +298,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|linebreaksbr }} {% else %} &nbsp; {% endif %}</span>
<span class="form-entry form-textarea not-complete">{% if order_wanted and responses.spouse_support_details %} {{responses.spouse_support_details|linebreaksul }} {% else %} &nbsp; {% endif %}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -325,7 +326,7 @@
</tr> </tr>
<tr> <tr>
<td> <i class="fa {% if responses.deal_with_property_debt == 'unequal division' %} 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' %} 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 %} {{ responses.how_to_divide_property_debt|linebreaksbr }} {% 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 %} {{ responses.how_to_divide_property_debt|linebreaksul }} {% else %}&nbsp;{% endif %}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -334,7 +335,7 @@
<tr> <tr>
{% check_list source=responses.want_other_property_claims value='Ask for other property claims' as other_wanted %} {% check_list source=responses.want_other_property_claims value='Ask for other property claims' as other_wanted %}
<td> <i class="fa {% if other_wanted %} 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 other_wanted %} 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 other_wanted and responses.other_property_claims %} {{ responses.other_property_claims|linebreaksbr }} {% else %}&nbsp;{% endif %}</span> </td>
<span class="form-entry form-textarea not-complete">{% if other_wanted and responses.other_property_claims %} {{ responses.other_property_claims|linebreaksul }} {% else %}&nbsp;{% endif %}</span> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -344,7 +345,7 @@
<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 %} 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 %} {{ responses.other_orders_detail|linebreaksbr }} {% else %} &nbsp; {% endif %}</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">{% if responses.other_orders_detail %} {{ responses.other_orders_detail|linebreaksul }} {% else %} &nbsp; {% endif %}</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>


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

@ -0,0 +1,14 @@
from django import template
import re
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
def linebreaksul(value):
"Converts strings with newlines into <ul><li></li></ul>s"
value = re.sub(r'\r\n|\r|\n', '\n', value.strip()) # normalize newlines
lines = re.split('\n', value)
lines = ['<li>%s</li>' % line for line in lines]
return mark_safe('<ul>%s</ul>' % '\n'.join(lines))

Loading…
Cancel
Save