From 5c2ef8f041106fb3360855452f5c834c810b1d07 Mon Sep 17 00:00:00 2001 From: Justin Johnson Date: Fri, 2 Mar 2018 14:56:47 -0800 Subject: [PATCH] DIV-827 --- edivorce/apps/core/static/css/weasyprint.css | 5 + .../core/templates/dashboard/print_form.html | 2 +- edivorce/apps/core/templates/pdf/form37.html | 93 ++++--- edivorce/apps/core/templates/pdf/form38.html | 180 +++++++----- .../apps/core/templates/pdf/form38_we.html | 262 ------------------ edivorce/apps/core/views/pdf.py | 13 +- 6 files changed, 176 insertions(+), 379 deletions(-) delete mode 100644 edivorce/apps/core/templates/pdf/form38_we.html diff --git a/edivorce/apps/core/static/css/weasyprint.css b/edivorce/apps/core/static/css/weasyprint.css index 141a6fbb..bfb934d1 100644 --- a/edivorce/apps/core/static/css/weasyprint.css +++ b/edivorce/apps/core/static/css/weasyprint.css @@ -234,6 +234,10 @@ ol.parens-list { ol.parens-list > li { list-style: none; position: relative; + padding-left: 0; +} +ol.parens-list > li > ul > li { + padding-left: 0; } ol.parens-list > li:before { @@ -243,6 +247,7 @@ ol.parens-list > li:before { left: -2.5em; } + .th-left { text-align: left !important; } diff --git a/edivorce/apps/core/templates/dashboard/print_form.html b/edivorce/apps/core/templates/dashboard/print_form.html index dfcb8711..8af55b43 100644 --- a/edivorce/apps/core/templates/dashboard/print_form.html +++ b/edivorce/apps/core/templates/dashboard/print_form.html @@ -273,7 +273,7 @@

- Review and Print diff --git a/edivorce/apps/core/templates/pdf/form37.html b/edivorce/apps/core/templates/pdf/form37.html index 44428aa8..d0375c97 100644 --- a/edivorce/apps/core/templates/pdf/form37.html +++ b/edivorce/apps/core/templates/pdf/form37.html @@ -119,49 +119,55 @@

  • The following is true to the best of my information and belief.

    -

    (a) Parties:

    - - - - - - - - - - - - - - - - - - -
    Claimant 1's nameProvince of residence
    {% response responses.name_you %}{% response responses.address_to_send_official_document_prov_you %}
    Claimant 2's nameProvince of residence
    {% response responses.name_spouse %}{% response responses.address_to_send_official_document_prov_spouse %}
    - -

    (b) Children:

    - - - - - - - - - - +
      +
    1. +

      Parties:

      + +
    Child's nameBirthdateAgeChild now living withRelationship to claimant 1Relationship to claimant 2
    + + + + + + + + + + + + + + + + +
    Claimant 1's nameProvince of residence
    {% response responses.name_you %}{% response responses.address_to_send_official_document_prov_you %}
    Claimant 2's nameProvince of residence
    {% response responses.name_spouse %}{% response responses.address_to_send_official_document_prov_spouse %}
    +
  • + +
  • +

    Children:

    + + + + + + + + + + {% for child in responses.children %} - - - - - - - - + + + + + + + + {% endfor %} -
    Child's nameBirthdateAgeChild now living withRelationship to claimant 1Relationship to claimant 2
    {{ child.child_name }}{{ child.child_birth_date|date_formatter }}  {{ child.child_birth_date|age }}{{ child.child_live_with|claimantize }}{{ child.child_relationship_to_you }}{{ child.child_relationship_to_spouse }}
    {{ child.child_name }}{{ child.child_birth_date|date_formatter }}  {{ child.child_birth_date|age }}{{ child.child_live_with|claimantize }}{{ child.child_relationship_to_you }}{{ child.child_relationship_to_spouse }}
    + +
  • + @@ -177,7 +183,7 @@
  • {% if responses.how_will_calculate_income == 'using specific rules' %} -
      +
      1. Claimant 1's annual income as determined under sections 15 to 20 of the Guidelines: {{ responses.annual_gross_income|money }} @@ -318,7 +324,8 @@ {% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 1' %} {% include 'pdf/partials/notary_signature.html' with name=responses.name_you %} - {% elif responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %} + {% endif %} + {% if responses.which_claimant == 'both' or responses.which_claimant == 'Claimant 2' %} {% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %} {% endif %} {% include 'pdf/partials/fact_sheet_a.html' %} diff --git a/edivorce/apps/core/templates/pdf/form38.html b/edivorce/apps/core/templates/pdf/form38.html index d5bc80e5..93c45493 100644 --- a/edivorce/apps/core/templates/pdf/form38.html +++ b/edivorce/apps/core/templates/pdf/form38.html @@ -22,7 +22,6 @@ - diff --git a/edivorce/apps/core/templates/pdf/form38_we.html b/edivorce/apps/core/templates/pdf/form38_we.html deleted file mode 100644 index b419126e..00000000 --- a/edivorce/apps/core/templates/pdf/form38_we.html +++ /dev/null @@ -1,262 +0,0 @@ -{% load static %} -{% load composites %} -{% load input_field %} -{% load format_utils %} - - - - - - - - Form 38 - - - - - - - - - {% include 'partials/gtm_head.html' %} - - - - - - - diff --git a/edivorce/apps/core/views/pdf.py b/edivorce/apps/core/views/pdf.py index 60c82410..e5942b9f 100644 --- a/edivorce/apps/core/views/pdf.py +++ b/edivorce/apps/core/views/pdf.py @@ -12,8 +12,8 @@ from ..decorators import bceid_required from ..utils.derived import get_derived_data from ..utils.user_response import get_responses_from_db -letters = 'abcdefghijklmnopqrstuvwxyz' -exhibits = list(letters.upper()[::-1]) +EXHIBITS = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'[::-1]) + @bceid_required def form(request, form_number): @@ -21,7 +21,8 @@ def form(request, form_number): responses = get_responses_from_db(request.user) - if form_number == '1' or form_number.startswith('37'): + if (form_number == '1' or form_number.startswith('37') or + form_number.startswith('38')): # Add an array of children that includes blanks for possible children under = int(responses.get('number_children_under_19') or 0) over = int(responses.get('number_children_under_19') or 0) @@ -41,7 +42,9 @@ def form(request, form_number): responses = __add_claimant_info(responses, '_spouse') responses['which_claimant'] = 'Claimant 2' - if form_number == '38_claimant1': + if form_number == "38": + responses["which_claimant"] = 'both' + elif form_number == '38_claimant1': form_number = '38' responses = __add_claimant_info(responses, '_you') responses['which_claimant'] = 'Claimant 1' @@ -54,7 +57,7 @@ def form(request, form_number): 'css_root': settings.WEASYPRINT_CSS_LOOPBACK, 'responses': responses, 'derived': get_derived_data(responses), - 'exhibits': exhibits[:], + 'exhibits': EXHIBITS[:], })