Browse Source

DIV-478: Updated PDF date format to be dd/mmm/yyyy

pull/160/head
Charles Shin 8 years ago
parent
commit
a46dea03c9
6 changed files with 41 additions and 27 deletions
  1. +19
    -19
      edivorce/apps/core/templates/pdf/form1.html
  2. +2
    -2
      edivorce/apps/core/templates/pdf/form35.html
  3. +3
    -2
      edivorce/apps/core/templates/pdf/form38.html
  4. +3
    -2
      edivorce/apps/core/templates/pdf/form38_we.html
  5. +3
    -2
      edivorce/apps/core/templates/pdf/form52.html
  6. +11
    -0
      edivorce/apps/core/templatetags/format_utils.py

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

@ -55,19 +55,19 @@
<td colspan="2"> Claimant 1 and Claimant 2: </td>
</tr>
<tr>
<td><i class="fa {% if responses.when_were_you_live_married_like %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} began to live together in a marriage-like relationship on [<em>dd/mm/yyyy</em>]</td>
<td colname="c2"> {% if responses.when_were_you_live_married_like %} {{ responses.when_were_you_live_married_like }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
<td><i class="fa {% if responses.when_were_you_live_married_like %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} began to live together in a marriage-like relationship on [<em>dd/mmm/yyyy</em>]</td>
<td colname="c2"> {% if responses.when_were_you_live_married_like %} {{ responses.when_were_you_live_married_like|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
</tr>
<tr>
<td><i class="fa {% if responses.when_were_you_married %} fa-check-square-o" aria-hidden="true"></i> {% else %} fa-square-o" aria-hidden="true"></i> {% endif %} were married on [<em>dd/mm/yyyy</em>]</td>
<td colname="c2"> {% if responses.when_were_you_married %} {{ responses.when_were_you_married }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
<td><i class="fa {% if responses.when_were_you_married %} fa-check-square-o" aria-hidden="true"></i> {% else %} fa-square-o" aria-hidden="true"></i> {% endif %} were married on [<em>dd/mmm/yyyy</em>]</td>
<td colname="c2"> {% if responses.when_were_you_married %} {{ responses.when_were_you_married|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
</tr>
<tr>
<td><i class="fa {% if responses.separation_date %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} separated on [dd/mm/yyyy]</td>
<td colname="c2"> {% if responses.separation_date %} {{ responses.separation_date }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
<td><i class="fa {% if responses.separation_date %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} separated on [dd/mmm/yyyy]</td>
<td colname="c2"> {% if responses.separation_date %} {{ responses.separation_date|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
</tr>
<tr>
<td><i class="fa fa-square-o" aria-hidden="true"></i> were divorced from each other by order made on [<em>dd/mm/yyyy</em>]</td>
<td><i class="fa fa-square-o" aria-hidden="true"></i> were divorced from each other by order made on [<em>dd/mmm/yyyy</em>]</td>
<td colname="c2"> <span class="form-entry not-complete">&nbsp;</span></td>
</tr>
<tr>
@ -93,18 +93,18 @@
<td colname="c3"> <strong> Claimant 2 </strong> </td>
</tr>
<tr>
<td> Birthdate: [<em>dd/mm/yyyy</em>] </td>
<td colname="c2">{% if responses.birthday_you %} {{ responses.birthday_you }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
<td colname="c3">{% if responses.birthday_spouse %} {{ responses.birthday_spouse }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
<td> Birthdate: [<em>dd/mmm/yyyy</em>] </td>
<td colname="c2">{% if responses.birthday_you %} {{ responses.birthday_you|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
<td colname="c3">{% if responses.birthday_spouse %} {{ responses.birthday_spouse|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %} </td>
</tr>
<tr>
<td> Ordinarily resident in British Columbia since: [<em>dd/mm/yyyy</em>] </td>
<td> Ordinarily resident in British Columbia since: [<em>dd/mmm/yyyy</em>] </td>
<td colname="c2">{% if responses.lived_in_bc_you == 'Since birth' %} {{ responses.birthday_you }}
{% elif responses.lived_in_bc_you == 'Moved to B.C. on' %} {{ responses.moved_to_bc_date_you }}
{% elif responses.lived_in_bc_you == 'Moved to B.C. on' %} {{ responses.moved_to_bc_date_you|date_formatter }}
{% elif responses.lived_in_bc_you == 'Do not live in B.C.' %}
{% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
<td colname="c3">{% if responses.lived_in_bc_spouse == 'Since birth' %} {{ responses.birthday_spouse }}
{% elif responses.lived_in_bc_spouse == 'Moved to B.C. on' %} {{ responses.moved_to_bc_date_spouse }}
{% elif responses.lived_in_bc_spouse == 'Moved to B.C. on' %} {{ responses.moved_to_bc_date_spouse|date_formatter }}
{% elif responses.lived_in_bc_spouse == 'Does not live in B.C.' %}
{% else %} <span class="form-entry not-complete">&nbsp;</span> {% endif %}</td>
</tr>
@ -147,7 +147,7 @@
<td colspan="2"> <strong> B. Grounds for claim for divorce: </strong></td>
</tr>
<tr>
<td colspan="2"> (i) <i class="fa {% if responses.separation_date %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} Claimant 1 and Claimant 2 have lived separate and apart since {% if responses.separation_date %} {{ responses.separation_date }} {% else %} <span class="form-entry not-complete">&nbsp;</span>{% endif %}</td>
<td colspan="2"> (i) <i class="fa {% if responses.separation_date %} fa-check-square-o" aria-hidden="true"></i>{% else %} fa-square-o" aria-hidden="true"></i> {% endif %} Claimant 1 and Claimant 2 have lived separate and apart since {% if responses.separation_date %} {{ responses.separation_date|date_formatter }} {% else %} <span class="form-entry not-complete">&nbsp;</span>{% endif %}</td>
</tr>
<tr>
<td colspan="2"> <strong> AND </strong ></em> </td>
@ -243,7 +243,7 @@
<table class="table table-fixed table-bordered">
<tr>
<td align="center"> Full name: </td>
<td align="center"> Birth date:<br />[<em>dd/mm/yyyy</em>] </td>
<td align="center"> Birth date:<br />[<em>dd/mmm/yyyy</em>] </td>
<td align="center"> Resides with: </td>
</tr>
<tr>
@ -390,7 +390,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>
@ -414,7 +414,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>
@ -457,7 +457,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>
@ -505,7 +505,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>


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

@ -101,7 +101,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>Signature of</p>
@ -135,7 +135,7 @@
</tr>
<tr>
<td class="sig-col1"></td>
<td class="sig-col2 sig-line-text">[dd/mm/yyyy]</td>
<td class="sig-col2 sig-line-text">[dd/mmm/yyyy]</td>
<td class="sig-col3"></td>
<td class="sig-col4 sig-line-text">
<p>Signature of</p>


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

@ -1,5 +1,6 @@
{% load static %}
{% load input_field %}
{% load format_utils %}
<!doctype html>
<html class="no-js" lang="en">
@ -81,11 +82,11 @@
<p class="schIndent1">
5 I was living separate and apart from my spouse at the start of this family law case and I have lived separate and apart from my spouse since
{% if responses.separation_date %} {{ responses.separation_date }}{% else %} <span class="form-entry not-complete"></span>{% endif %}, except:
{% if responses.separation_date %} {{ responses.separation_date|date_formatter }}{% else %} <span class="form-entry not-complete"></span>{% endif %}, except:
{% multiple_values_to_list source=responses.reconciliation_period as periods %}
{% if periods != '[]' and responses.try_reconcile_after_separated == 'YES' %}
{% for period in periods %}
from {{ period | first }} to {{ period | last }}{% if not forloop.last %}, {% endif %}
from {{ period | first |date_formatter }} to {{ period | last |date_formatter }}{% if not forloop.last %}, {% endif %}
{% endfor %}.
{% else %}<span class="form-entry not-complete"></span>{% endif %}
</p>


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

@ -1,5 +1,6 @@
{% load static %}
{% load input_field %}
{% load format_utils %}
<!doctype html>
<html class="no-js" lang="en">
@ -91,11 +92,11 @@
<p class="schIndent1">
5 Claimant 1 and claimant 2 were living separate and apart from each other at the start of this family law case and claimant 1 and claimant 2 have lived separate and apart from each other since
{% if responses.separation_date %} {{ responses.separation_date }}{% else %} <span class="form-entry not-complete"></span>{% endif %}, except:
{% if responses.separation_date %} {{ responses.separation_date|date_formatter }}{% else %} <span class="form-entry not-complete"></span>{% endif %}, except:
{% multiple_values_to_list source=responses.reconciliation_period as periods %}
{% if periods != '[]' and responses.try_reconcile_after_separated == 'YES' %}
{% for period in periods %}
from {{ period | first }} to {{ period | last }}{% if not forloop.last %}, {% endif %}
from {{ period | first|date_formatter }} to {{ period | last|date_formatter }}{% if not forloop.last %}, {% endif %}
{% endfor %}.
{% else %}<span class="form-entry not-complete"></span>{% endif %}
</p>


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

@ -1,5 +1,6 @@
{% load static %}
{% load input_field %}
{% load format_utils %}
<!doctype html>
<html class="no-js" lang="en">
@ -90,11 +91,11 @@
{% if responses.where_were_you_married_country == 'Other' %} {{ responses.where_were_you_married_other_country }}
{% else %} {{responses.where_were_you_married_country}}{% endif %}
{% else %}<span class="form-entry not-complete"></span>{% endif %}
on {% if responses.when_were_you_married %} {{ responses.when_were_you_married }} {% else %}<span class="form-entry not-complete"></span>{% endif %}, are divorced from each other,
on {% if responses.when_were_you_married %} {{ responses.when_were_you_married|date_formatter }} {% else %}<span class="form-entry not-complete"></span>{% endif %}, are divorced from each other,
{% if responses.divorce_take_effect_on == 'the 31st day after the date of this order' %}
the divorce to take effect on the 31st day after the date of this order.
{% else %}
the divorce to take effect on {% if responses.divorce_take_effect_on_specific_date %}{{ responses.divorce_take_effect_on_specific_date }}{% else %}<span class="form-entry not-complete"></span>{% endif %}.
the divorce to take effect on {% if responses.divorce_take_effect_on_specific_date %}{{ responses.divorce_take_effect_on_specific_date|date_formatter }}{% else %}<span class="form-entry not-complete"></span>{% endif %}.
{% endif %}
</p>


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

@ -1,4 +1,5 @@
from django import template
from datetime import datetime
import re
from django.utils.safestring import mark_safe
@ -12,3 +13,13 @@ def linebreaksul(value):
lines = re.split('\n', value)
lines = ['<li>%s</li>' % line for line in lines if line and not line.isspace()]
return mark_safe('<ul>%s</ul>' % '\n'.join(lines))
@register.filter
def date_formatter(value):
"""
Changes date format from dd/mm/yyyy to dd/mmm/yyyy
"""
d = datetime.strptime(value, '%d/%m/%Y')
return d.strftime('%d %b %Y')

Loading…
Cancel
Save