Browse Source

Hide inapplicable form steps

pull/160/head
Mike Olund 8 years ago
parent
commit
ccb10bfb01
20 changed files with 267 additions and 67 deletions
  1. +30
    -18
      edivorce/apps/core/templates/overview.html
  2. +29
    -16
      edivorce/apps/core/templates/progress.html
  3. +3
    -1
      edivorce/apps/core/templates/question/01_orders.html
  4. +5
    -2
      edivorce/apps/core/templates/question/02_claimant.html
  5. +7
    -3
      edivorce/apps/core/templates/question/03_respondent.html
  6. +5
    -2
      edivorce/apps/core/templates/question/04_marriage.html
  7. +5
    -2
      edivorce/apps/core/templates/question/05_separation.html
  8. +5
    -2
      edivorce/apps/core/templates/question/06_support.html
  9. +7
    -3
      edivorce/apps/core/templates/question/07_property.html
  10. +8
    -4
      edivorce/apps/core/templates/question/08_other_orders.html
  11. +6
    -3
      edivorce/apps/core/templates/question/09_other_questions.html
  12. +6
    -3
      edivorce/apps/core/templates/question/10_location.html
  13. +19
    -6
      edivorce/apps/core/templates/question/11_review.html
  14. +9
    -0
      edivorce/apps/core/templatetags/load_json.py
  15. +27
    -0
      edivorce/apps/core/templatetags/next_step.py
  16. +42
    -0
      edivorce/apps/core/templatetags/prev_step.py
  17. +25
    -0
      edivorce/apps/core/templatetags/step_order.py
  18. +1
    -1
      edivorce/apps/core/urls.py
  19. +25
    -0
      edivorce/apps/core/utils/template_step_order.py
  20. +3
    -1
      edivorce/apps/core/views/main.py

+ 30
- 18
edivorce/apps/core/templates/overview.html View File

@ -1,4 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load step_order %}
{% load load_json %}
{% block title %}{{ block.super }}: Overview{% endblock %} {% block title %}{{ block.super }}: Overview{% endblock %}
@ -8,69 +10,79 @@
<h2>Answer the Questions Related to Your Divorce Questionnaire</h2> <h2>Answer the Questions Related to Your Divorce Questionnaire</h2>
<div class="progress-column"> <div class="progress-column">
<a href="{% url 'prequalification' '01' %}" class="progress-question complete {% if active_page == 'prequalification' %} active {% endif %}">
<a href="{% url 'prequalification' '01' %}" class="progress-question complete">
<span class="progress-icon"><i class="fa fa-share-alt" aria-hidden="true"></i></span> <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-content">Qualifying Questions</span>
<span class="progress-status"><i class="fa fa-check" aria-hidden="true"></i></span> <span class="progress-status"><i class="fa fa-check" aria-hidden="true"></i></span>
</a> </a>
<a href="{% url 'question_steps' '01_orders' %}" class="progress-question {% if active_page == '01_orders' %} active {% endif %}">
<a href="{% url 'question_steps' 'orders' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-commenting" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 1</small><br />What Are You Asking For?</span>
{% if step_status.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>
<a href="{% url 'question_steps' '02_claimant' %}" class="progress-question {% if active_page == '02_claimant' %} active {% endif %}">
<a href="{% url 'question_steps' 'claimant' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-info" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 2</small><br />Your information</span>
{% if step_status.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>
<a href="{% url 'question_steps' '03_respondent' %}" class="progress-question {% if active_page == '03_respondent' %} active {% endif %}">
<a href="{% url 'question_steps' 'respondent' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-user" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 3</small><br />Your spouse</span>
{% if step_status.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>
<a href="{% url 'question_steps' '04_marriage' %}" class="progress-question {% if active_page == '04_marriage' %} active {% endif %}">
<a href="{% url 'question_steps' 'marriage' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-link" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 4</small><br />Your marriage</span>
{% if step_status.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>
<a href="{% url 'question_steps' '05_separation' %}" class="progress-question {% if active_page == '05_separation' %} active {% endif %}">
<a href="{% url 'question_steps' 'separation' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-chain-broken" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 5</small><br />Your separation</span>
{% if step_status.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>
<a href="{% url 'question_steps' '06_support' %}" class="progress-question {% if active_page == '06_support' %} active {% endif %}">
{% if 'Spousal support' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'support' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-life-ring" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 6</small><br />Spousal support</span>
{% if step_status.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>
<a href="{% url 'question_steps' '07_property' %}" class="progress-question {% if active_page == '07_property' %} active {% endif %}">
{% endif %}
{% if 'Division of property and debts' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'property' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-home" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="property" %}</small><br />Property and debt</span>
{% if step_status.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>
<a href="{% url 'question_steps' '08_other_orders' %}" class="progress-question {% if active_page == '08_other_orders' %} active {% endif %}">
{% endif %}
{% if 'Other orders' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'other_orders' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-gavel" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="other_orders" %}</small><br />Other orders</span>
{% if step_status.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>
<a href="{% url 'question_steps' '09_other_questions' %}" class="progress-question {% if active_page == '09_other_questions' %} active {% endif %}">
{% endif %}
<a href="{% url 'question_steps' 'other_questions' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-question" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="other_questions" %}</small><br />Other questions</span>
{% if step_status.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>
<a href="{% url 'question_steps' '10_location' %}" class="progress-question {% if active_page == '10_location' %} active {% endif %}">
<a href="{% url 'question_steps' 'location' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-location-arrow" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="location" %}</small><br />Filing locations</span>
{% if step_status.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>
<a href="{% url 'question_steps' '11_review' %}" class="progress-question {% if active_page == '11_review' %} active {% endif %}">
<a href="{% url 'question_steps' 'review' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-file" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="review" %}</small><br />Review</span>
</a> </a>
</div> </div>
<!-- TODO once all questions in uncategorized are placed in right step, remove it --> <!-- TODO once all questions in uncategorized are placed in right step, remove it -->
<ul> <ul>
<li style="display: flex"><a href="{% url 'question_steps' '12_uncategorized' %}">Step 12: Uncategorized</a></li>
<li style="display: flex"><a href="{% url 'question_steps' 'uncategorized' %}">Step 12: Uncategorized</a></li>
</ul> </ul>
{% endblock %} {% endblock %}


+ 29
- 16
edivorce/apps/core/templates/progress.html View File

@ -1,3 +1,6 @@
{% load step_order %}
{% load load_json %}
<div class="col-flex progress-column"> <div class="col-flex progress-column">
<h4>Questionnaire</h4> <h4>Questionnaire</h4>
<a href="{% url 'prequalification' '01' %}" class="progress-question complete {% if active_page == 'prequalification' %} active {% endif %}"> <a href="{% url 'prequalification' '01' %}" class="progress-question complete {% if active_page == 'prequalification' %} active {% endif %}">
@ -5,59 +8,69 @@
<span class="progress-content">Qualifying Questions</span> <span class="progress-content">Qualifying Questions</span>
<span class="progress-status"><i class="fa fa-check" aria-hidden="true"></i></span> <span class="progress-status"><i class="fa fa-check" aria-hidden="true"></i></span>
</a> </a>
<a href="{% url 'question_steps' '01_orders' %}" class="progress-question {% if active_page == '01_orders' %} active {% endif %}">
<a href="{% url 'question_steps' 'orders' %}" class="progress-question {% if active_page == 'orders' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-commenting" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 1</small><br />What Are You Asking For?</span>
{% if step_status.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>
<a href="{% url 'question_steps' '02_claimant' %}" class="progress-question {% if active_page == '02_claimant' %} active {% endif %}">
<a href="{% url 'question_steps' 'claimant' %}" class="progress-question {% if active_page == 'claimant' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-info" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 2</small><br />Your information</span>
{% if step_status.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>
<a href="{% url 'question_steps' '03_respondent' %}" class="progress-question {% if active_page == '03_respondent' %} active {% endif %}">
<a href="{% url 'question_steps' 'respondent' %}" class="progress-question {% if active_page == 'respondent' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-user" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 3</small><br />Your spouse</span>
{% if step_status.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>
<a href="{% url 'question_steps' '04_marriage' %}" class="progress-question {% if active_page == '04_marriage' %} active {% endif %}">
<a href="{% url 'question_steps' 'marriage' %}" class="progress-question {% if active_page == 'marriage' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-link" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 4</small><br />Your marriage</span>
{% if step_status.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>
<a href="{% url 'question_steps' '05_separation' %}" class="progress-question {% if active_page == '05_separation' %} active {% endif %}">
<a href="{% url 'question_steps' 'separation' %}" class="progress-question {% if active_page == 'separation' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-chain-broken" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 5</small><br />Your separation</span>
{% if step_status.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>
<a href="{% url 'question_steps' '06_support' %}" class="progress-question {% if active_page == '06_support' %} active {% endif %}">
{% if 'Spousal support' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'support' %}" class="progress-question {% if active_page == 'support' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-life-ring" aria-hidden="true"></i></span> <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> <span class="progress-content"><small>Step 6</small><br />Spousal support</span>
{% if step_status.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>
<a href="{% url 'question_steps' '07_property' %}" class="progress-question {% if active_page == '07_property' %} active {% endif %}">
{% endif %}
{% if 'Division of property and debts' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'property' %}" class="progress-question {% if active_page == 'property' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-home" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="property" %}</small><br />Property and debt</span>
{% if step_status.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>
<a href="{% url 'question_steps' '08_other_orders' %}" class="progress-question {% if active_page == '08_other_orders' %} active {% endif %}">
{% endif %}
{% if 'Other orders' in want_which_orders|load_json %}
<a href="{% url 'question_steps' 'other_orders' %}" class="progress-question {% if active_page == 'other_orders' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-gavel" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="other_orders" %}</small><br />Other orders</span>
{% if step_status.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>
<a href="{% url 'question_steps' '09_other_questions' %}" class="progress-question {% if active_page == '09_other_questions' %} active {% endif %}">
{% endif %}
<a href="{% url 'question_steps' 'other_questions' %}" class="progress-question {% if active_page == 'other_questions' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-question" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="other_questions" %}</small><br />Other questions</span>
{% if step_status.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>
<a href="{% url 'question_steps' '10_location' %}" class="progress-question {% if active_page == '10_location' %} active {% endif %}">
<a href="{% url 'question_steps' 'location' %}" class="progress-question {% if active_page == 'location' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-location-arrow" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="location" %}</small><br />Filing locations</span>
{% if step_status.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>
<a href="{% url 'question_steps' '11_review' %}" class="progress-question {% if active_page == '11_review' %} active {% endif %}">
<a href="{% url 'question_steps' 'review' %}" class="progress-question {% if active_page == 'review' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-file" aria-hidden="true"></i></span> <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>
<span class="progress-content"><small>Step {% step_order step="review" %}</small><br />Review</span>
</a> </a>

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

@ -1,5 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Prequalification{% endblock %} {% block title %}{{ block.super }}: Prequalification{% endblock %}
@ -135,7 +137,7 @@
{% endblock %} {% endblock %}
{% block formBack %}{% url 'overview' %}{% endblock %} {% block formBack %}{% url 'overview' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '02_claimant' %}{% endblock %}
{% block formNext %}{% next_step step='orders' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<p>An order is the record of the judge's decision. It is filed at the court registry.</p> <p>An order is the record of the judge's decision. It is filed at the court registry.</p>


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Your Information{% endblock %} {% block title %}{{ block.super }}: Your Information{% endblock %}
@ -170,8 +173,8 @@
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '01_orders' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '03_respondent' %}{% endblock %}
{% block formBack %}{% prev_step step='claimant' %}{% endblock %}
{% block formNext %}{% next_step step='claimant' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<p>The Meaning of "Ordinary Residence" and "Habitual Residence" in the Common Law Provinces in a Family Law Context: <a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/divorce/rhro_cl/p4.html" target="_blank">http://www.justice.gc.ca/eng/rp-pr/fl-lf/divorce/rhro_cl/p4.html</a></p> <p>The Meaning of "Ordinary Residence" and "Habitual Residence" in the Common Law Provinces in a Family Law Context: <a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/divorce/rhro_cl/p4.html" target="_blank">http://www.justice.gc.ca/eng/rp-pr/fl-lf/divorce/rhro_cl/p4.html</a></p>

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

@ -1,4 +1,8 @@
{% extends 'base.html' %}{% load input_field %}
{% extends 'base.html' %}
{% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Your Spouse{% endblock %} {% block title %}{{ block.super }}: Your Spouse{% endblock %}
@ -166,8 +170,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '02_claimant' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '04_marriage' %}{% endblock %}
{% block formBack %}{% prev_step step='respondent' %}{% endblock %}
{% block formNext %}{% next_step step='respondent' %}{% endblock %}
{% block sidebarNav %} {% block sidebarNav %}
<!-- no sidebar --> <!-- no sidebar -->


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Your Marriage{% endblock %} {% block title %}{{ block.super }}: Your Marriage{% endblock %}
@ -113,8 +116,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '03_respondent' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '05_separation' %}{% endblock %}
{% block formBack %}{% prev_step step='marriage' %}{% endblock %}
{% block formNext %}{% next_step step='marriage' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<div> <div>


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Reason For Divorce{% endblock %} {% block title %}{{ block.super }}: Reason For Divorce{% endblock %}
@ -67,8 +70,8 @@
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '04_marriage' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '06_support' %}{% endblock %}
{% block formBack %}{% prev_step step='separation' %}{% endblock %}
{% block formNext %}{% next_step step='separation' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<div> <div>


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Declarations{% endblock %} {% block title %}{{ block.super }}: Declarations{% endblock %}
@ -125,8 +128,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '05_separation' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '07_property' %}{% endblock %}
{% block formBack %}{% prev_step step='support' %}{% endblock %}
{% block formNext %}{% next_step step='support' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<div> <div>


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

@ -1,12 +1,16 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load step_order %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Application Location{% endblock %} {% block title %}{{ block.super }}: Application Location{% endblock %}
{% block progress %}{% include "progress.html" %}{% endblock %} {% block progress %}{% include "progress.html" %}{% endblock %}
{% block content %} {% block content %}
<h1><small>Step 7:</small>Property and Debt</h1>
<h1><small>Step {% step_order step="property" %}:</small>Property and Debt</h1>
<div class="intro"> <div class="intro">
<p>After you separate, the law says that all <span class="tooltip-link" data-toggle="tooltip" data-placement="right" data-html="true" title="<b>Family property</b><br /><br />The assest acquired by either spouse during the course of the relationship, <p>After you separate, the law says that all <span class="tooltip-link" data-toggle="tooltip" data-placement="right" data-html="true" title="<b>Family property</b><br /><br />The assest acquired by either spouse during the course of the relationship,
plus any increase in the value of excluded property. The law assumes that you're both entitled to an equal share of family property unless an equal division would be significantly unfair."> family property plus any increase in the value of excluded property. The law assumes that you're both entitled to an equal share of family property unless an equal division would be significantly unfair."> family property
@ -115,8 +119,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '06_support' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '08_other_orders' %}{% endblock %}
{% block formBack %}{% prev_step step='property' %}{% endblock %}
{% block formNext %}{% next_step step='property' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<div> <div>


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

@ -1,4 +1,8 @@
{% extends 'base.html' %}{% load input_field %}
{% extends 'base.html' %}
{% load input_field %}
{% load step_order %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Other Orders{% endblock %} {% block title %}{{ block.super }}: Other Orders{% endblock %}
@ -7,14 +11,14 @@
{% block content %} {% block content %}
<h1><small>Step 8:</small>Other Orders</h1>
<h1><small>Step {% step_order step="other_orders" %}:</small>Other Orders</h1>
<h3>Want other orders as follows: </h3> <h3>Want other orders as follows: </h3>
{% input_field type="textarea" name="other_orders_detail" rows="8" cols="65" class="response-textarea" %} {% input_field type="textarea" name="other_orders_detail" rows="8" cols="65" class="response-textarea" %}
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '07_property' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '09_other_questions' %}{% endblock %}
{% block formBack %}{% prev_step step='other_orders' %}{% endblock %}
{% block formNext %}{% next_step step='other_orders' %}{% endblock %}
{% block sidebarNav %} {% block sidebarNav %}
<!-- no sidebar --> <!-- no sidebar -->


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load step_order %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Spousal Support{% endblock %} {% block title %}{{ block.super }}: Spousal Support{% endblock %}
@ -8,7 +11,7 @@
{% block content %} {% block content %}
<h1><small>Step 9:</small>Other Questions</h1>
<h1><small>Step {% step_order step="other_questions" %}:</small>Other Questions</h1>
<div class="question-well"> <div class="question-well">
<div> <div>
@ -96,8 +99,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '08_other_orders' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '10_location' %}{% endblock %}
{% block formBack %}{% prev_step step='other_questions' %}{% endblock %}
{% block formNext %}{% next_step step='other_questions' %}{% endblock %}
{% block sidebarNav %} {% block sidebarNav %}
<!-- no sidebar --> <!-- no sidebar -->


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

@ -1,5 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load step_order %}
{% load next_step %}
{% load prev_step %}
{% block title %}{{ block.super }}: Property And Debts{% endblock %} {% block title %}{{ block.super }}: Property And Debts{% endblock %}
@ -8,7 +11,7 @@
{% block content %} {% block content %}
<h1><small>Step 10:</small>Filing Location</h1>
<h1><small>Step {% step_order step="location" %}:</small>Filing Location</h1>
<p> <p>
Ok, we're almost done asking you questions. The last set of information that we need to know is where Ok, we're almost done asking you questions. The last set of information that we need to know is where
you will be filing your divorce document. You will need to file your documents in person at a court registry. you will be filing your divorce document. You will need to file your documents in person at a court registry.
@ -34,8 +37,8 @@
</div> </div>
{% endblock %} {% endblock %}
{% block formBack %}{% url 'question_steps' '09_other_questions' %}{% endblock %}
{% block formNext %}{% url 'question_steps' '11_review' %}{% endblock %}
{% block formBack %}{% prev_step step='location' %}{% endblock %}
{% block formNext %}{% next_step step='location' %}{% endblock %}
{% block sidebarText %} {% block sidebarText %}
<div> <div>


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

@ -1,4 +1,7 @@
{% extends 'base.html' %}{% load input_field %}
{% extends 'base.html' %}
{% load input_field %}
{% load step_order %}
{% load load_json %}
{% block title %}{{ block.super }}: Review{% endblock %} {% block title %}{{ block.super }}: Review{% endblock %}
@ -6,7 +9,7 @@
{% block content %} {% block content %}
<h1><small>Step 11:</small>Review</h1>
<h1><small>Step {% step_order step="review" %}:</small>Review</h1>
<ul> <ul>
<li> <li>
<h4>Pre-qualification questions</h4> <h4>Pre-qualification questions</h4>
@ -32,24 +35,34 @@
<h4>Step 5: Your separation</h4> <h4>Step 5: Your separation</h4>
{% include "partials/review_user_responses.html" with questions=your_separation %} {% include "partials/review_user_responses.html" with questions=your_separation %}
</li> </li>
{% if 'Spousal support' in want_which_orders|load_json %}
<li> <li>
<h4>Step 6: Spousal support</h4> <h4>Step 6: Spousal support</h4>
{% include "partials/review_user_responses.html" with questions=spousal_support %} {% include "partials/review_user_responses.html" with questions=spousal_support %}
</li> </li>
{% endif %}
{% if 'Division of property and debts' in want_which_orders|load_json %}
<li> <li>
<h4>Step 7: Property and debt</h4>
<h4>Step {% step_order step="property" %}: Property and debt</h4>
{% include "partials/review_user_responses.html" with questions=property_and_debt %} {% include "partials/review_user_responses.html" with questions=property_and_debt %}
</li> </li>
{% endif %}
{% if 'Other orders' in want_which_orders|load_json %}
<li> <li>
<h4>Step 8: Other orders</h4>
<h4>Step {% step_order step="other_orders" %}: Other orders</h4>
{% include "partials/review_user_responses.html" with questions=other_orders %} {% include "partials/review_user_responses.html" with questions=other_orders %}
</li> </li>
{% endif %}
<li> <li>
<h4>Step 9: Other questions</h4>
<h4>Step {% step_order step="other_questions" %}: Other questions</h4>
{% include "partials/review_user_responses.html" with questions=other_questions %} {% include "partials/review_user_responses.html" with questions=other_questions %}
</li> </li>
<li> <li>
<h4>Step 10: Filing locations</h4>
<h4>Step {% step_order step="location" %}: Filing locations</h4>
{% include "partials/review_user_responses.html" with questions=filing_locations %} {% include "partials/review_user_responses.html" with questions=filing_locations %}
</li> </li>
</ul> </ul>


+ 9
- 0
edivorce/apps/core/templatetags/load_json.py View File

@ -0,0 +1,9 @@
import json
from django import template
register = template.Library()
@register.filter
def load_json(data):
return json.loads(data)

+ 27
- 0
edivorce/apps/core/templatetags/next_step.py View File

@ -0,0 +1,27 @@
from django import template
import json
from ..utils.template_step_order import template_step_order, get_step_name
register = template.Library()
@register.simple_tag(takes_context=True)
def next_step(context, step):
want_which_orders = json.loads(context.get('want_which_orders', '[]'))
current_step_base_order = template_step_order[step]
next = current_step_base_order + 1
if current_step_base_order == 5 and 'Spousal support' not in want_which_orders:
next += 1
if next == 6 and 'Division of property and debts' not in want_which_orders:
next += 1
if next == 7 and 'Other orders' not in want_which_orders:
next += 1
return get_step_name(next)

+ 42
- 0
edivorce/apps/core/templatetags/prev_step.py View File

@ -0,0 +1,42 @@
from django import template
import json
from ..utils.template_step_order import template_step_order, get_step_name
register = template.Library()
@register.simple_tag(takes_context=True)
def step_order(context, step):
want_which_orders = json.loads(context.get('want_which_orders', '[]'))
base_order = template_step_order[step]
order = base_order
if base_order > 6 and 'Spousal support' not in want_which_orders:
order -= 1
if base_order > 7 and 'Division of property and debts' not in want_which_orders:
order -= 1
if base_order > 8 and 'Other orders' not in want_which_orders:
order -= 1
return order
@register.simple_tag(takes_context=True)
def prev_step(context, step):
want_which_orders = json.loads(context.get('want_which_orders', '[]'))
current_step_base_order = template_step_order[step]
prev = current_step_base_order - 1
if current_step_base_order > 6 and 'Spousal support' not in want_which_orders:
prev -= 1
if current_step_base_order > 7 and 'Division of property and debts' not in want_which_orders:
prev -= 1
if current_step_base_order > 8 and 'Other orders' not in want_which_orders:
prev -= 1
return get_step_name(prev)

+ 25
- 0
edivorce/apps/core/templatetags/step_order.py View File

@ -0,0 +1,25 @@
from django import template
import json
from ..utils.template_step_order import template_step_order
register = template.Library()
@register.simple_tag(takes_context=True)
def step_order(context, step):
want_which_orders = json.loads(context.get('want_which_orders', '[]'))
base_order = template_step_order[step]
order = base_order
if base_order > 6 and 'Spousal support' not in want_which_orders:
order -= 1
if base_order > 7 and 'Division of property and debts' not in want_which_orders:
order -= 1
if base_order > 8 and 'Other orders' not in want_which_orders:
order -= 1
return order

+ 1
- 1
edivorce/apps/core/urls.py View File

@ -24,7 +24,7 @@ urlpatterns = [
url(r'^pdf-form(?P<form_number>[0-9]{1,3})$', pdf.form, name="pdf_form"), url(r'^pdf-form(?P<form_number>[0-9]{1,3})$', pdf.form, name="pdf_form"),
url(r'^prequalification/step_(?P<step>[0-9]{2})$', main.prequalification, name="prequalification"), url(r'^prequalification/step_(?P<step>[0-9]{2})$', main.prequalification, name="prequalification"),
url(r'^question/(?P<step>.*)', main.question, name="question_steps"),
url(r'^question/(?P<step>.*)$', main.question, name="question_steps"),
url(r'^', main.intro, name="intro"), url(r'^', main.intro, name="intro"),
] ]


+ 25
- 0
edivorce/apps/core/utils/template_step_order.py View File

@ -0,0 +1,25 @@
"""
Mapping between question step names and the numerical values assigned
to their templates
"""
template_step_order = {
'orders': 1,
'claimant': 2,
'respondent': 3,
'marriage': 4,
'separation': 5,
'support': 6,
'property': 7,
'other_orders': 8,
'other_questions': 9,
'location': 10,
'review': 11
}
def get_step_name(step_order):
"""
Preforms a reverse lookup in the template_step_order dictionary
"""
return next(k for k, v in template_step_order.items() if v == step_order)

+ 3
- 1
edivorce/apps/core/views/main.py View File

@ -1,6 +1,7 @@
from django.conf import settings from django.conf import settings
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from django.utils import timezone from django.utils import timezone
from edivorce.apps.core.utils.template_step_order import template_step_order
from ..decorators import bceid_required from ..decorators import bceid_required
import datetime import datetime
from ..models import BceidUser from ..models import BceidUser
@ -109,7 +110,8 @@ def question(request, step):
View rendering main questions View rendering main questions
For review page, use response grouped by step to render page For review page, use response grouped by step to render page
""" """
template = 'question/%s.html' % step
template = 'question/%02d_%s.html' % (template_step_order[step], step)
user = __get_bceid_user(request) user = __get_bceid_user(request)
responses_dict_by_step = get_responses_from_db_grouped_by_steps(user) responses_dict_by_step = get_responses_from_db_grouped_by_steps(user)


Loading…
Cancel
Save