Browse Source

Show asterisk on required fields.

feature/python-error-tracking
Drew Larson 8 years ago
parent
commit
efb780fc76
  1. 6
      bikeshop_project/registration/models.py
  2. 6
      bikeshop_project/registration/templates/member_form.html

6
bikeshop_project/registration/models.py

@ -79,9 +79,9 @@ class Member(models.Model):
null=True, null=True,
blank=True, blank=True,
) )
email_consent = models.BooleanField(default=False) email_consent = models.BooleanField(default=False, blank=False)
first_name = models.CharField(max_length=255, null=False) first_name = models.CharField(max_length=255, null=False, blank=False)
last_name = models.CharField(max_length=255, null=False) last_name = models.CharField(max_length=255, null=False, blank=False)
preferred_name = models.CharField(max_length=255, null=True, blank=True) preferred_name = models.CharField(max_length=255, null=True, blank=True)
date_of_birth = models.DateField(null=True, blank=True) date_of_birth = models.DateField(null=True, blank=True)
guardian_name = models.CharField(max_length=255, null=True, blank=True) guardian_name = models.CharField(max_length=255, null=True, blank=True)

6
bikeshop_project/registration/templates/member_form.html

@ -97,7 +97,7 @@
</div> </div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.first_name.errors %}is-invalid{% endif %}"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.first_name.errors %}is-invalid{% endif %}">
{{ form.first_name }} {{ form.first_name }}
<label class="mdl-textfield__label" for="{{ form.first_name.id_for_label }}">{{ form.first_name.label }}</label> <label class="mdl-textfield__label" for="{{ form.first_name.id_for_label }}">{{ form.first_name.label }}{% if form.first_name.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.first_name.errors %} {% if form.first_name.errors %}
<span class="mdl-textfield__error">{{ form.first_name.errors }}</span> <span class="mdl-textfield__error">{{ form.first_name.errors }}</span>
{% else %} {% else %}
@ -106,7 +106,7 @@
</div> </div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.last_name.errors %}is-invalid{% endif %}"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.last_name.errors %}is-invalid{% endif %}">
{{ form.last_name }} {{ form.last_name }}
<label class="mdl-textfield__label" for="{{ form.last_name.id_for_label }}">{{ form.last_name.label }}</label> <label class="mdl-textfield__label" for="{{ form.last_name.id_for_label }}">{{ form.last_name.label }}{% if form.last_name.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.last_name.errors %} {% if form.last_name.errors %}
<span class="mdl-textfield__error">{{ form.last_name.errors }}</span> <span class="mdl-textfield__error">{{ form.last_name.errors }}</span>
{% else %} {% else %}
@ -151,7 +151,7 @@
</div> </div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.post_code.errors %}is-invalid{% endif %}"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label {% if form.post_code.errors %}is-invalid{% endif %}">
{{ form.post_code }} {{ form.post_code }}
<label class="mdl-textfield__label" for="{{ form.post_code.id_for_label }}">{{ form.post_code.label }}</label> <label class="mdl-textfield__label" for="{{ form.post_code.id_for_label }}">{{ form.post_code.label }}{% if form.post_code.field.required %} <sup>*</sup>{% endif %}</label>
{% if form.post_code.errors %} {% if form.post_code.errors %}
<span class="mdl-textfield__error">{{ form.post_code.errors }}</span> <span class="mdl-textfield__error">{{ form.post_code.errors }}</span>
{% else %} {% else %}

Loading…
Cancel
Save