Commit 4567b3b5 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

I got customized inline form errors for daaaaaaaaaaaays

parent 8b781001
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<hr /> <hr />
<ul class="text-center"> <ul class="text-center">
{% for error in form.non_field_errors %} {% for error in form.non_field_errors %}
<li class="text-danger">{{ error }}</li> <li class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<hr /> <hr />
......
...@@ -44,6 +44,15 @@ ...@@ -44,6 +44,15 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% if my_form.non_field_errors %}
<hr />
<ul class="text-center">
{% for error in my_form.non_field_errors %}
<li class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</li>
{% endfor %}
</ul>
<hr />
{% endif %}
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ my_form.as_p }} {{ my_form.as_p }}
<hr/> <hr/>
......
...@@ -40,13 +40,23 @@ ...@@ -40,13 +40,23 @@
{% if error in my_form.non_field_errors %} {% if error in my_form.non_field_errors %}
<ul class="text-center"> <ul class="text-center">
{% for error in my_form.non_field_errors %} {% for error in my_form.non_field_errors %}
<li>{{ error }}</li> <li class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
<div class="panel-body"> <div class="panel-body">
<form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %} <form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %}
<fieldset> <fieldset>
{% if my_form.first_name.errors %}
{% for error in my_form.first_name.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
{% if my_form.last_name.errors %}
{% for error in my_form.last_name.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for="{{ my_form.first_name.id_for_label }}" class="col-md-2">First Name</label> <label for="{{ my_form.first_name.id_for_label }}" class="col-md-2">First Name</label>
<div class="col-md-4"> <div class="col-md-4">
...@@ -72,6 +82,11 @@ ...@@ -72,6 +82,11 @@
</div> </div>
</div> </div>
{% if my_form.gender.errors %}
{% for error in my_form.gender.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for="{{ my_form.gender.id_for_label }}" class="col-md-3"> <label for="{{ my_form.gender.id_for_label }}" class="col-md-3">
Gender Identity<br />(choose all that apply) Gender Identity<br />(choose all that apply)
...@@ -85,6 +100,11 @@ ...@@ -85,6 +100,11 @@
{% endfor %} {% endfor %}
</div> </div>
{% if my_form.show_gender.errors %}
{% for error in my_form.show_gender.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for "{{ my_form.show_gender.id_for_label }}" class="col-md-3"> <label for "{{ my_form.show_gender.id_for_label }}" class="col-md-3">
Show Gender on Profile? Show Gender on Profile?
......
...@@ -55,17 +55,22 @@ ...@@ -55,17 +55,22 @@
<div class="panel-body"> <div class="panel-body">
{% if not request.user.student.recent_changes > 2 %} {% if not request.user.student.recent_changes > 2 %}
{% spaceless %} {% spaceless %}
{% if my_form.non_field_errors %}
<hr /> <hr />
{% if my_form.non_field_errors %}
<ul class="text-center"> <ul class="text-center">
{% for error in form.non_field_errors %} {% for error in my_form.non_field_errors %}
<li>{{ error }}</li> <li class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<hr /> <hr />
{% endif %} {% endif %}
<form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %} <form class="form-horizontal" autocomplete="off" action="" method="post">{% csrf_token %}
<fieldset> <fieldset>
{% if my_form.on_campus.errors %}
{% for error in form.on_campus.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for="{{ my_form.on_campus.id_for_label }}" class="col-md-3"> <label for="{{ my_form.on_campus.id_for_label }}" class="col-md-3">
Do You Live on Campus? Do You Live on Campus?
...@@ -80,11 +85,21 @@ ...@@ -80,11 +85,21 @@
We'll let everyone know when we add them. Until then, if you live there, you're We'll let everyone know when we add them. Until then, if you live there, you're
still welcome to browse around. still welcome to browse around.
</small></p> </small></p>
{% if my_form.room.errors %}
{% for error in form.room.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<div class="col-md-12"> <div class="col-md-12">
{{ my_form.room }} {{ my_form.room }}
</div> </div>
</div> </div>
{% if my_form.privacy.errors %}
{% for error in form.privacy.errors %}
<p class="text-danger"><i class="fa fa-exclamation-triangle fa-fw"></i> {{ error }}</p>
{% endfor %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for="{{ my_form.privacy.id_for_label }}" class="col-md-2"> <label for="{{ my_form.privacy.id_for_label }}" class="col-md-2">
Privacy Privacy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment