Browse Source

Show error message warning if any errors on page

pull/163/head
ariannedee 5 years ago
parent
commit
9107ac1060
4 changed files with 47 additions and 9 deletions
  1. +1
    -1
      edivorce/apps/core/static/css/main.css
  2. +22
    -0
      edivorce/apps/core/static/css/main.scss
  3. +16
    -8
      edivorce/apps/core/templates/question/12_review.html
  4. +8
    -0
      edivorce/apps/core/utils/derived.py

+ 1
- 1
edivorce/apps/core/static/css/main.css
File diff suppressed because it is too large
View File


+ 22
- 0
edivorce/apps/core/static/css/main.scss View File

@ -19,6 +19,8 @@ $color-green: #57b26a;
$color-green-light: #d9f6df; $color-green-light: #d9f6df;
$color-gold-light: #e6ca85; $color-gold-light: #e6ca85;
$color-red: #D8292F; $color-red: #D8292F;
$color-red-light: #F7D4D5;
$color-red-dark: #AC2025;
$font-custom: Myriad-Pro, Calibri, Arial, Sans Serif; $font-custom: Myriad-Pro, Calibri, Arial, Sans Serif;
$font-custom-bold: Myriad-Pro-Bold, Calibri, Arial, Sans Serif; $font-custom-bold: Myriad-Pro-Bold, Calibri, Arial, Sans Serif;
@ -679,6 +681,26 @@ i.fa.fa-question-circle {
} }
} }
.review-warning {
background-color: $color-red-light;
padding: 20px;
margin: 30px 0;
border-radius: 8px;
display: flex;
.exclamation i {
font-size: 25px;
color: $color-red-dark;
}
div {
margin: 10px;
}
.warning, .progress-status i {
color: $color-red-dark;
font-weight: bolder;
margin: 0 3px;
}
}
.error { .error {
border: 2px solid $color-red !important; border: 2px solid $color-red !important;
-webkit-transition: 0.1s ease-in-out all; -webkit-transition: 0.1s ease-in-out all;


+ 16
- 8
edivorce/apps/core/templates/question/12_review.html View File

@ -214,7 +214,20 @@
</div> </div>
</div> </div>
</div> </div>
{% if derived.any_errors == True %}
<div class="review-warning">
<div><span class="exclamation"><i class="fa fa-fw fa-exclamation-circle"></i></span></div>
<div>
You have not completed at least one field that is required to create your forms.
Missing required fields are noted on this screen in the
following way: <span class="warning">MISSING REQUIRED FIELD</span>
Forms which are missing fields will be identified with the following symbol:
<span class="progress-status"><i class="fa fa-adjust" aria-hidden="true"></i></span>
Please ensure that all required fields are
completed and then return to this page.
</div>
</div>
{% endif %}
<div id="questions_modal" class="modal in" tabindex="-1" role="dialog" style="display: block"> <div id="questions_modal" class="modal in" tabindex="-1" role="dialog" style="display: block">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
@ -236,13 +249,8 @@
{% endblock %} {% endblock %}
{% block formbuttons %}
<div class="form-buttons clearfix">
<a class="btn btn-success pull-right" href="{% url 'dashboard_nav' 'print_form' %}">Next&nbsp;&nbsp;&nbsp;<i class="fa fa-arrow-circle-o-right"></i></a>
</div>
{% endblock %}
{% block formBack %}{% prev_step step='review' %}{% endblock %}
{% block formNext %}{% url 'dashboard_nav' 'print_form' %}{% endblock %}
{% block sidebarNav %} {% block sidebarNav %}
<!-- no sidebar --> <!-- no sidebar -->


+ 8
- 0
edivorce/apps/core/utils/derived.py View File

@ -87,6 +87,7 @@ DERIVED_DATA = [
'pursuant_parenting_arrangement', 'pursuant_parenting_arrangement',
'pursuant_child_support', 'pursuant_child_support',
'sole_custody', 'sole_custody',
'any_errors',
] ]
@ -744,6 +745,13 @@ def sole_custody(responses, derived):
return conditional_logic.determine_sole_custody(responses) return conditional_logic.determine_sole_custody(responses)
def any_errors(responses, derived):
for question_key in responses:
if question_key.endswith('_error'):
return True
return False
def _any_question_errors(responses, questions): def _any_question_errors(responses, questions):
for field in questions: for field in questions:
error_field_name = f'{field}_error' error_field_name = f'{field}_error'


Loading…
Cancel
Save