diff --git a/edivorce/apps/core/templates/prequalification/step_01.html b/edivorce/apps/core/templates/prequalification/step_01.html index 20e4047b..32d3c421 100644 --- a/edivorce/apps/core/templates/prequalification/step_01.html +++ b/edivorce/apps/core/templates/prequalification/step_01.html @@ -5,7 +5,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} diff --git a/edivorce/apps/core/templates/prequalification/step_02.html b/edivorce/apps/core/templates/prequalification/step_02.html index 8b523c69..558bc769 100644 --- a/edivorce/apps/core/templates/prequalification/step_02.html +++ b/edivorce/apps/core/templates/prequalification/step_02.html @@ -5,7 +5,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} diff --git a/edivorce/apps/core/templates/prequalification/step_03.html b/edivorce/apps/core/templates/prequalification/step_03.html index 36752581..bcbcc9cc 100644 --- a/edivorce/apps/core/templates/prequalification/step_03.html +++ b/edivorce/apps/core/templates/prequalification/step_03.html @@ -5,7 +5,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} diff --git a/edivorce/apps/core/templates/prequalification/step_04.html b/edivorce/apps/core/templates/prequalification/step_04.html index 63a19abf..c6ed34a8 100644 --- a/edivorce/apps/core/templates/prequalification/step_04.html +++ b/edivorce/apps/core/templates/prequalification/step_04.html @@ -5,7 +5,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/prequalification/step_05.html b/edivorce/apps/core/templates/prequalification/step_05.html index 814076a5..319108d5 100644 --- a/edivorce/apps/core/templates/prequalification/step_05.html +++ b/edivorce/apps/core/templates/prequalification/step_05.html @@ -6,7 +6,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} diff --git a/edivorce/apps/core/templates/prequalification/step_06.html b/edivorce/apps/core/templates/prequalification/step_06.html index 465c3d42..cbf55549 100644 --- a/edivorce/apps/core/templates/prequalification/step_06.html +++ b/edivorce/apps/core/templates/prequalification/step_06.html @@ -5,7 +5,7 @@ {% block progress %} {% if request.bceid_user.is_authenticated %} - {% include "progress.html" with step=active_page %} + {% include "progress.html" %} {% endif %} {% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/progress.html b/edivorce/apps/core/templates/progress.html index e2690fb8..6f0c4ffe 100644 --- a/edivorce/apps/core/templates/progress.html +++ b/edivorce/apps/core/templates/progress.html @@ -1,62 +1,61 @@

Questionnaire

- - + Qualifying Questions - + Step 1
What Are You Asking For?
- {% if which_orders == 'Started' %} {% endif %} + {% if step_status.which_orders == 'Started' %} {% endif %}
- + Step 2
Your information
- {% if your_information == 'Started' %} {% endif %} + {% if step_status.your_information == 'Started' %} {% endif %}
- + Step 3
Your spouse
- {% if your_spouse == 'Started' %} {% endif %} + {% if step_status.your_spouse == 'Started' %} {% endif %}
- + Step 4
Your marriage
- {% if your_marriage == 'Started' %} {% endif %} + {% if step_status.your_marriage == 'Started' %} {% endif %}
- + Step 5
Your separation
- {% if your_separation == 'Started' %} {% endif %} + {% if step_status.your_separation == 'Started' %} {% endif %}
- + Step 6
Spousal support
- {% if spousal_support == 'Started' %} {% endif %} + {% if step_status.spousal_support == 'Started' %} {% endif %}
- + Step 7
Property and debt
- {% if property_and_debt == 'Started' %} {% endif %} + {% if step_status.property_and_debt == 'Started' %} {% endif %}
- + Step 8
Other orders
- {% if other_orders == 'Started' %} {% endif %} + {% if step_status.other_orders == 'Started' %} {% endif %}
- + Step 9
Other questions
- {% if other_questions == 'Started' %} {% endif %} + {% if step_status.other_questions == 'Started' %} {% endif %}
- + Step 10
Filing locations
- {% if filing_locations == 'Started' %} {% endif %} + {% if step_status.filing_locations == 'Started' %} {% endif %}
- + Step 11
Review
diff --git a/edivorce/apps/core/templates/question/01_orders.html b/edivorce/apps/core/templates/question/01_orders.html index fd52e297..70e9ad5c 100644 --- a/edivorce/apps/core/templates/question/01_orders.html +++ b/edivorce/apps/core/templates/question/01_orders.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Prequalification{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/02_claimant.html b/edivorce/apps/core/templates/question/02_claimant.html index 9f530486..8d4a2a6e 100644 --- a/edivorce/apps/core/templates/question/02_claimant.html +++ b/edivorce/apps/core/templates/question/02_claimant.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Your Information{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/03_respondent.html b/edivorce/apps/core/templates/question/03_respondent.html index eb13f379..bf31026c 100644 --- a/edivorce/apps/core/templates/question/03_respondent.html +++ b/edivorce/apps/core/templates/question/03_respondent.html @@ -2,7 +2,7 @@ {% block title %}{{ block.super }}: Your Spouse{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/04_marriage.html b/edivorce/apps/core/templates/question/04_marriage.html index f4531432..aa0bde5e 100644 --- a/edivorce/apps/core/templates/question/04_marriage.html +++ b/edivorce/apps/core/templates/question/04_marriage.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Your Marriage{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/05_separation.html b/edivorce/apps/core/templates/question/05_separation.html index 071e841b..8ae3bab4 100644 --- a/edivorce/apps/core/templates/question/05_separation.html +++ b/edivorce/apps/core/templates/question/05_separation.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Reason For Divorce{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/06_support.html b/edivorce/apps/core/templates/question/06_support.html index 1aeeb1e7..b2802107 100644 --- a/edivorce/apps/core/templates/question/06_support.html +++ b/edivorce/apps/core/templates/question/06_support.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Declarations{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/07_property.html b/edivorce/apps/core/templates/question/07_property.html index a2d3a303..2b3a24ea 100644 --- a/edivorce/apps/core/templates/question/07_property.html +++ b/edivorce/apps/core/templates/question/07_property.html @@ -2,7 +2,7 @@ {% load input_field %} {% block title %}{{ block.super }}: Application Location{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/08_other_orders.html b/edivorce/apps/core/templates/question/08_other_orders.html index bd69cb60..e654768c 100644 --- a/edivorce/apps/core/templates/question/08_other_orders.html +++ b/edivorce/apps/core/templates/question/08_other_orders.html @@ -2,7 +2,7 @@ {% block title %}{{ block.super }}: Other Orders{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/09_other_questions.html b/edivorce/apps/core/templates/question/09_other_questions.html index 0b36f1c2..1ffdb0dd 100644 --- a/edivorce/apps/core/templates/question/09_other_questions.html +++ b/edivorce/apps/core/templates/question/09_other_questions.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Spousal Support{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/10_location.html b/edivorce/apps/core/templates/question/10_location.html index aaf0086c..5cb70c9f 100644 --- a/edivorce/apps/core/templates/question/10_location.html +++ b/edivorce/apps/core/templates/question/10_location.html @@ -3,7 +3,7 @@ {% block title %}{{ block.super }}: Property And Debts{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/templates/question/11_review.html b/edivorce/apps/core/templates/question/11_review.html index 02b06658..376e4125 100644 --- a/edivorce/apps/core/templates/question/11_review.html +++ b/edivorce/apps/core/templates/question/11_review.html @@ -2,7 +2,7 @@ {% block title %}{{ block.super }}: Review{% endblock %} -{% block progress %}{% include "progress.html" with step=active_page %}{% endblock %} +{% block progress %}{% include "progress.html" %}{% endblock %} {% block content %} diff --git a/edivorce/apps/core/utils/user_response.py b/edivorce/apps/core/utils/user_response.py index 289f8ff2..1c4d25be 100644 --- a/edivorce/apps/core/utils/user_response.py +++ b/edivorce/apps/core/utils/user_response.py @@ -19,6 +19,16 @@ def get_responses_from_db_grouped_by_steps(bceid_user): return responses_dict +def get_step_status(responses_by_step): + status_dict = {} + for step, lst in responses_by_step.items(): + if not lst: + status_dict[step] = "Not started" + else: + status_dict[step] = "Started" + return status_dict + + def get_responses_from_session(request): return sorted(request.session.items()) diff --git a/edivorce/apps/core/views/main.py b/edivorce/apps/core/views/main.py index fe3831e3..a254b704 100644 --- a/edivorce/apps/core/views/main.py +++ b/edivorce/apps/core/views/main.py @@ -5,7 +5,7 @@ from ..decorators import bceid_required import datetime from ..models import BceidUser from ..utils.user_response import get_responses_from_db, get_responses_from_db_grouped_by_steps, \ - get_responses_from_session, copy_session_to_db + get_responses_from_session, copy_session_to_db, get_step_status from edivorce.apps.core.utils.question_step_mapping import list_of_registries from django.core.exceptions import ObjectDoesNotExist @@ -86,6 +86,8 @@ def prequalification(request, step): user = __get_bceid_user(request) responses_dict = get_responses_from_db(user) + responses_dict['active_page'] = 'prequalification' + responses_dict['step_status'] = get_step_status(get_responses_from_db_grouped_by_steps(user)) return render(request, template_name=template, context=responses_dict) @@ -106,15 +108,19 @@ def question(request, step): """ template = 'question/%s.html' % step user = __get_bceid_user(request) + responses_dict_by_step = get_responses_from_db_grouped_by_steps(user) if step == "11_review": - responses_dict = get_responses_from_db_grouped_by_steps(user) + responses_dict = responses_dict_by_step else: responses_dict = get_responses_from_db(user) responses_dict['active_page'] = step # If page is filing location page, add registries dictionary for list of court registries if step == "10_location": responses_dict['registries'] = sorted(list_of_registries) + + # Add step status dictionary + responses_dict['step_status'] = get_step_status(responses_dict_by_step) return render(request, template_name=template, context=responses_dict)