diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index c6387566..2da58203 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -74,6 +74,27 @@ $(function () { } }); + // For want which order page + // If either Spousal support or Division of property and debts is not selected show alert message + // if user still wants to proceed(click next again), let them proceed to next page + $('#check_order_selected').on('click', function (e) { + var showAlert = $(this).data('show_alert'); + var proceedNext = $(this).data('proceed'); + if (!showAlert) { + $(".checkbox-group input:checkbox").not(":checked").each(function () { + console.log($(this).val()); + if ($(this).val() == 'Division of property and debts' || $(this).val() == 'Spousal support') { + showAlert = true; + } + }); + } + if (showAlert && !proceedNext) { + $('#unselected_orders_alert').show(); + e.preventDefault(); + $(this).data('proceed', true); + } + }); + // spinner $('body').on('click', 'input.spinner, a.spinner', function () { $('div#progress-overlay').show(); diff --git a/edivorce/apps/core/templates/base.html b/edivorce/apps/core/templates/base.html index 5eef051e..dbacf7f2 100644 --- a/edivorce/apps/core/templates/base.html +++ b/edivorce/apps/core/templates/base.html @@ -101,7 +101,7 @@ {% block formbuttons %}
   Back - Next    + Next       Save and return another time
{% endblock %} diff --git a/edivorce/apps/core/templates/dashboard/print_form.html b/edivorce/apps/core/templates/dashboard/print_form.html index c1df38c5..04d34320 100644 --- a/edivorce/apps/core/templates/dashboard/print_form.html +++ b/edivorce/apps/core/templates/dashboard/print_form.html @@ -119,11 +119,11 @@

Claimant 1

- Preview | Print + Preview | Print

Claimant 2

- Preview | Print + Preview | Print
diff --git a/edivorce/apps/core/templates/pdf/form38.html b/edivorce/apps/core/templates/pdf/form38.html index 6a3f8d76..63ff03ad 100644 --- a/edivorce/apps/core/templates/pdf/form38.html +++ b/edivorce/apps/core/templates/pdf/form38.html @@ -26,7 +26,7 @@ This is the [1st/2nd/3rd/etc.] affidavit

- of [name] in this case + of {% if responses.name_claimant %}{{ responses.name_claimant }}{% else %}[name]{% endif %} in this case

and was made on [dd/mmm/yyyy] @@ -50,11 +50,11 @@ AFFIDAVIT - DESK ORDER DIVORCE

- I, {% if responses.name_you %}{{ responses.name_you }}{% else %}[name]{% endif %}, of - {% if responses.address_to_send_official_document_street_you and responses.address_to_send_official_document_city_you and responses.address_to_send_official_document_prov_you and responses.address_to_send_official_document_country_you and responses.address_to_send_official_document_postal_code_you %} - {{ responses.address_to_send_official_document_street_you }}, {{ responses.address_to_send_official_document_city_you }}, {{ responses.address_to_send_official_document_prov_you }}, - {% if responses.address_to_send_official_document_country_you == 'Other' %} {{ responses.address_to_send_official_document_other_country_you }}{% else %} {{ responses.address_to_send_official_document_country_you }}{% endif %}, {{ responses.address_to_send_official_document_postal_code_you }} {% else %}[address]{% endif %}, - {% if responses.occupation_you %} {{ responses.occupation_you }}{% else %}[occupation]{% endif %}, SWEAR (OR AFFIRM) THAT: + I, {% if responses.name_claimant %}{{ responses.name_claimant }}{% else %}[name]{% endif %}, of + {% if responses.address_to_send_official_document_street_claimant and responses.address_to_send_official_document_city_claimant and responses.address_to_send_official_document_prov_claimant and responses.address_to_send_official_document_country_claimant and responses.address_to_send_official_document_postal_code_claimant %} + {{ responses.address_to_send_official_document_street_claimant }}, {{ responses.address_to_send_official_document_city_claimant }}, {{ responses.address_to_send_official_document_prov_claimant }}, + {% if responses.address_to_send_official_document_country_claimant == 'Other' %} {{ responses.address_to_send_official_document_other_country_claimant }}{% else %} {{ responses.address_to_send_official_document_country_claimant }}{% endif %}, {{ responses.address_to_send_official_document_postal_code_claimant }} {% else %}[address]{% endif %}, + {% if responses.occupation_claimant %} {{ responses.occupation_claimant }}{% else %}[occupation]{% endif %}, SWEAR (OR AFFIRM) THAT:

1 I am [the claimant/the respondent/Claimant 1/Claimant 2]. @@ -138,7 +138,7 @@ {% if responses.form38_dummy_new_name %}

- 8 Pursuant to section 5 of the Name Act, I am seeking to change my name from {% if responses.name_you %}{{ responses.name_you }}{% else %} {% endif %} to {% if responses.form38_dummy_new_name %}{{ responses.form38_dummy_new_name }}{% else %} {% endif %}. This application for a name change relates only to myself. + 8 Pursuant to section 5 of the Name Act, I am seeking to change my name from {% if responses.name_claimant %}{{ responses.name_claimant }}{% else %} {% endif %} to {% if responses.form38_dummy_new_name %}{{ responses.form38_dummy_new_name }}{% else %} {% endif %}. This application for a name change relates only to myself.

{% endif %} diff --git a/edivorce/apps/core/templates/question/01_orders.html b/edivorce/apps/core/templates/question/01_orders.html index 76051bc3..f4e94b6f 100644 --- a/edivorce/apps/core/templates/question/01_orders.html +++ b/edivorce/apps/core/templates/question/01_orders.html @@ -101,7 +101,7 @@
{% endcomment %} -
+
-{% endblock %} {% block formBack %}{% url 'overview' %}{% endblock %} {% block formNext %}{% next_step step='orders' %}{% endblock %} {% block sidebarText %} +{% endblock %} {% block formBack %}{% url 'overview' %}{% endblock %} {% block formNext %}{% next_step step='orders' %}{% endblock %}{% block nextButtonAttribute %}id="check_order_selected" data-proceed="false" data-show_alert="false"{% endblock %} +{% block sidebarText %}

An order is the record of the judge's decision. It is filed at the court registry.

In Supreme Court, the parties involved in a case (or their lawyers) are responsible for telling the court the order(s) they want. This is done by putting the details in writing in their application and in a draft of the order to be signed by the judge diff --git a/edivorce/apps/core/urls.py b/edivorce/apps/core/urls.py index b8e58483..e219e00b 100644 --- a/edivorce/apps/core/urls.py +++ b/edivorce/apps/core/urls.py @@ -22,7 +22,7 @@ urlpatterns = [ url(r'^divorce-dev/headers$', system.headers), url(r'^headers$', system.headers), - url(r'^pdf-form(?P[0-9]{1,3}(_we)?)$', pdf.form, name="pdf_form"), + url(r'^pdf-form(?P[0-9]{1,3}(_we|_claimant1|_claimant2)?)$', pdf.form, name="pdf_form"), url(r'^prequalification/step_(?P[0-9]{2})$', main.prequalification, name="prequalification"), url(r'^question/(?P.*)$', main.question, name="question_steps"), url(r'^', main.intro, name="intro"), diff --git a/edivorce/apps/core/views/pdf.py b/edivorce/apps/core/views/pdf.py index dfb7dc44..df35ac29 100644 --- a/edivorce/apps/core/views/pdf.py +++ b/edivorce/apps/core/views/pdf.py @@ -14,6 +14,13 @@ def form(request, form_number): user = BceidUser.objects.get(user_guid=request.bceid_user.guid) responses = get_responses_from_db(user) + if form_number == "38_claimant1": + form_number = "38" + responses = add_claimant_info(responses, '_you') + elif form_number == "38_claimant2": + form_number = "38" + responses = add_claimant_info(responses, '_spouse') + return render_form(request, 'form%s' % form_number, { "css_root": settings.WEASYPRINT_CSS_LOOPBACK, @@ -45,3 +52,13 @@ def render_form(request, form_name, context): response['Content-Disposition'] = 'inline;filename=' + form_name + '.pdf' return response + + +def add_claimant_info(responses, claimant): + claimant_info = {} + for key in responses: + if key.endswith(claimant): + claimant_key = key.replace(claimant, '_claimant') + claimant_info[claimant_key] = responses[key] + responses.update(claimant_info) + return responses