Browse Source

DIV-714: Insert the name of the payor into fact sheet B

pull/160/head
Benard Ebinu 8 years ago
parent
commit
f4db36d2ec
2 changed files with 19 additions and 1 deletions
  1. +2
    -1
      edivorce/apps/core/templates/question/06_children_facts.html
  2. +17
    -0
      edivorce/apps/core/templatetags/format_utils.py

+ 2
- 1
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load input_field %}
{% load step_order %}
{% load format_utils %}
{% block title %}{{ block.super }}: Your Children {% endblock %}
@ -420,7 +421,7 @@
</tr>
<tr>
<td class="fact-sheet-question">
Amount of child support to be paid per month by {% if child_support_payor %}{{ child_support_payor|lower }}{% else %}the payor{% endif %}
Amount of child support to be paid per month by {% payorize %}
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
<div class="dollar-prefix">


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

@ -120,3 +120,20 @@ def money(amount, symbol=True):
pass
return ''
@register.simple_tag(takes_context=True)
def payorize(context):
payor = 'the payor'
child_support_payor = context.get('child_support_payor', None)
if child_support_payor == 'Myself (Claimant 1)':
payor = context.get('name_you', child_support_payor)
elif child_support_payor == 'My Spouse (Claimant 2)':
payor = context.get('name_spouse', child_support_payor)
elif child_support_payor == 'Both myself and my spouse':
payor = '{} and {}'.format(context.get('name_you', 'myself'),
context.get('name_spouse', 'my spouse'))
return payor

Loading…
Cancel
Save