Browse Source

DIV-164: Implement progress indicator status

pull/160/head
Charles Shin 8 years ago
parent
commit
60d3b67d4f
20 changed files with 57 additions and 42 deletions
  1. +1
    -1
      edivorce/apps/core/templates/prequalification/step_01.html
  2. +1
    -1
      edivorce/apps/core/templates/prequalification/step_02.html
  3. +1
    -1
      edivorce/apps/core/templates/prequalification/step_03.html
  4. +1
    -1
      edivorce/apps/core/templates/prequalification/step_04.html
  5. +1
    -1
      edivorce/apps/core/templates/prequalification/step_05.html
  6. +1
    -1
      edivorce/apps/core/templates/prequalification/step_06.html
  7. +22
    -23
      edivorce/apps/core/templates/progress.html
  8. +1
    -1
      edivorce/apps/core/templates/question/01_orders.html
  9. +1
    -1
      edivorce/apps/core/templates/question/02_claimant.html
  10. +1
    -1
      edivorce/apps/core/templates/question/03_respondent.html
  11. +1
    -1
      edivorce/apps/core/templates/question/04_marriage.html
  12. +1
    -1
      edivorce/apps/core/templates/question/05_separation.html
  13. +1
    -1
      edivorce/apps/core/templates/question/06_support.html
  14. +1
    -1
      edivorce/apps/core/templates/question/07_property.html
  15. +1
    -1
      edivorce/apps/core/templates/question/08_other_orders.html
  16. +1
    -1
      edivorce/apps/core/templates/question/09_other_questions.html
  17. +1
    -1
      edivorce/apps/core/templates/question/10_location.html
  18. +1
    -1
      edivorce/apps/core/templates/question/11_review.html
  19. +10
    -0
      edivorce/apps/core/utils/user_response.py
  20. +8
    -2
      edivorce/apps/core/views/main.py

+ 1
- 1
edivorce/apps/core/templates/prequalification/step_01.html View File

@ -5,7 +5,7 @@
{% block progress %}
{% if request.bceid_user.is_authenticated %}
{% include "progress.html" with step=active_page %}
{% include "progress.html" %}
{% endif %}
{% endblock %}


+ 1
- 1
edivorce/apps/core/templates/prequalification/step_02.html View File

@ -5,7 +5,7 @@
{% block progress %}
{% if request.bceid_user.is_authenticated %}
{% include "progress.html" with step=active_page %}
{% include "progress.html" %}
{% endif %}
{% endblock %}


+ 1
- 1
edivorce/apps/core/templates/prequalification/step_03.html View File

@ -5,7 +5,7 @@
{% block progress %}
{% if request.bceid_user.is_authenticated %}
{% include "progress.html" with step=active_page %}
{% include "progress.html" %}
{% endif %}
{% endblock %}


+ 1
- 1
edivorce/apps/core/templates/prequalification/step_04.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/prequalification/step_05.html View File

@ -6,7 +6,7 @@
{% block progress %}
{% if request.bceid_user.is_authenticated %}
{% include "progress.html" with step=active_page %}
{% include "progress.html" %}
{% endif %}
{% endblock %}


+ 1
- 1
edivorce/apps/core/templates/prequalification/step_06.html View File

@ -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 %}


+ 22
- 23
edivorce/apps/core/templates/progress.html View File

@ -1,62 +1,61 @@
<div class="col-flex progress-column">
<h4>Questionnaire</h4>
<a href="{% url 'prequalification' '01' %}" class="progress-question complete">
<a href="{% url 'prequalification' '01' %}" class="progress-question complete {% if active_page == 'prequalification' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-share-alt" aria-hidden="true"></i></span>
<span class="progress-content">Qualifying Questions</span>
<span class="progress-status"><i class="fa fa-check" aria-hidden="true"></i></span>
</a>
<a href="{% url 'question_steps' '01_orders' %}" class="progress-question {% if step == '01_orders' %} active {% endif %}">
<a href="{% url 'question_steps' '01_orders' %}" class="progress-question {% if active_page == '01_orders' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-commenting" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 1</small><br />What Are You Asking For?</span>
{% if which_orders == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.which_orders == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '02_claimant' %}" class="progress-question {% if step == '02_claimant' %} active {% endif %}">
<a href="{% url 'question_steps' '02_claimant' %}" class="progress-question {% if active_page == '02_claimant' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-info" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 2</small><br />Your information</span>
{% if your_information == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.your_information == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '03_respondent' %}" class="progress-question {% if step == '03_respondent' %} active {% endif %}">
<a href="{% url 'question_steps' '03_respondent' %}" class="progress-question {% if active_page == '03_respondent' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-user" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 3</small><br />Your spouse</span>
{% if your_spouse == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.your_spouse == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '04_marriage' %}" class="progress-question {% if step == '04_marriage' %} active {% endif %}">
<a href="{% url 'question_steps' '04_marriage' %}" class="progress-question {% if active_page == '04_marriage' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-link" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 4</small><br />Your marriage</span>
{% if your_marriage == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.your_marriage == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '05_separation' %}" class="progress-question {% if step == '05_separation' %} active {% endif %}">
<a href="{% url 'question_steps' '05_separation' %}" class="progress-question {% if active_page == '05_separation' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-chain-broken" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 5</small><br />Your separation</span>
{% if your_separation == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.your_separation == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '06_support' %}" class="progress-question {% if step == '06_support' %} active {% endif %}">
<a href="{% url 'question_steps' '06_support' %}" class="progress-question {% if active_page == '06_support' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-life-ring" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 6</small><br />Spousal support</span>
{% if spousal_support == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.spousal_support == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '07_property' %}" class="progress-question {% if step == '07_property' %} active {% endif %}">
<a href="{% url 'question_steps' '07_property' %}" class="progress-question {% if active_page == '07_property' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-home" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 7</small><br />Property and debt</span>
{% if property_and_debt == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.property_and_debt == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '08_other_orders' %}" class="progress-question {% if step == '08_other_orders' %} active {% endif %}">
<a href="{% url 'question_steps' '08_other_orders' %}" class="progress-question {% if active_page == '08_other_orders' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-gavel" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 8</small><br />Other orders</span>
{% if other_orders == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.other_orders == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '09_other_questions' %}" class="progress-question {% if step == '09_other_questions' %} active {% endif %}">
<a href="{% url 'question_steps' '09_other_questions' %}" class="progress-question {% if active_page == '09_other_questions' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-question" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 9</small><br />Other questions</span>
{% if other_questions == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.other_questions == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '10_location' %}" class="progress-question {% if step == '10_location' %} active {% endif %}">
<a href="{% url 'question_steps' '10_location' %}" class="progress-question {% if active_page == '10_location' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-location-arrow" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 10</small><br />Filing locations</span>
{% if filing_locations == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
{% if step_status.filing_locations == 'Started' %}<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span> {% endif %}
</a>
<a href="{% url 'question_steps' '11_review' %}" class="progress-question {% if step == '11_review' %} active {% endif %}">
<a href="{% url 'question_steps' '11_review' %}" class="progress-question {% if active_page == '11_review' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-file" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step 11</small><br />Review</span>
</a>


+ 1
- 1
edivorce/apps/core/templates/question/01_orders.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/02_claimant.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/03_respondent.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/04_marriage.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/05_separation.html View File

@ -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 %}


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

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/07_property.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/08_other_orders.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/09_other_questions.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/10_location.html View File

@ -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 %}


+ 1
- 1
edivorce/apps/core/templates/question/11_review.html View File

@ -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 %}


+ 10
- 0
edivorce/apps/core/utils/user_response.py View File

@ -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())


+ 8
- 2
edivorce/apps/core/views/main.py View File

@ -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)


Loading…
Cancel
Save