From c1aab5deb3f03e734627bcfd07aeac2cd99bed5b Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Thu, 9 Mar 2017 21:57:43 -0800 Subject: [PATCH] Updated overview page --- edivorce/apps/core/templates/overview.html | 74 ++++++++++++++++++---- edivorce/apps/core/views/main.py | 15 ++--- 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/edivorce/apps/core/templates/overview.html b/edivorce/apps/core/templates/overview.html index 89a75edf..afcad776 100644 --- a/edivorce/apps/core/templates/overview.html +++ b/edivorce/apps/core/templates/overview.html @@ -7,19 +7,69 @@ {% block content %}

Answer the Questions Related to Your Divorce Questionnaire

+
+ + + Qualifying Questions + + + + + Step 1
What Are You Asking For?
+ {% if step_status.which_orders == 'Started' %} {% endif %} +
+ + + Step 2
Your information
+ {% if step_status.your_information == 'Started' %} {% endif %} +
+ + + Step 3
Your spouse
+ {% if step_status.your_spouse == 'Started' %} {% endif %} +
+ + + Step 4
Your marriage
+ {% if step_status.your_marriage == 'Started' %} {% endif %} +
+ + + Step 5
Your separation
+ {% if step_status.your_separation == 'Started' %} {% endif %} +
+ + + Step 6
Spousal support
+ {% if step_status.spousal_support == 'Started' %} {% endif %} +
+ + + Step 7
Property and debt
+ {% if step_status.property_and_debt == 'Started' %} {% endif %} +
+ + + Step 8
Other orders
+ {% if step_status.other_orders == 'Started' %} {% endif %} +
+ + + Step 9
Other questions
+ {% if step_status.other_questions == 'Started' %} {% endif %} +
+ + + Step 10
Filing locations
+ {% if step_status.filing_locations == 'Started' %} {% endif %} +
+ + + Step 11
Review
+
+
+ diff --git a/edivorce/apps/core/views/main.py b/edivorce/apps/core/views/main.py index a254b704..de1a176c 100644 --- a/edivorce/apps/core/views/main.py +++ b/edivorce/apps/core/views/main.py @@ -132,16 +132,11 @@ def overview(request): mark that step as "Started" otherwise "Not started" """ user = __get_bceid_user(request) - responses_dict = get_responses_from_db_grouped_by_steps(user) - # To Show whether user has started to respond questions in each step - started_dict = {} - for step, lst in responses_dict.items(): - if not lst: - started_dict[step] = "Not started" - else: - started_dict[step] = "Started" - started_dict['active_page'] = 'overview' - return render(request, 'overview.html', context=started_dict) + responses_dict_by_step = get_responses_from_db_grouped_by_steps(user) + # step status dictionary + status_dict = {'step_status': get_step_status(responses_dict_by_step), + 'active_page': 'overview'} + return render(request, 'overview.html', context=status_dict) def __get_bceid_user(request):