Added tos to registration

This commit is contained in:
Zakary Timson 2018-01-27 11:17:40 -05:00
parent 0ea98fbd49
commit 3b1f8aa6f5
2 changed files with 17 additions and 4 deletions

View File

@ -27,10 +27,11 @@ class RegisterForm(forms.ModelForm):
password1 = forms.CharField(widget=forms.PasswordInput(), validators=[password_length]) password1 = forms.CharField(widget=forms.PasswordInput(), validators=[password_length])
password2 = forms.CharField(widget=forms.PasswordInput()) password2 = forms.CharField(widget=forms.PasswordInput())
provide_training = forms.CharField(max_length=255, required=False, label='Offer Training For...') provide_training = forms.CharField(max_length=255, required=False, label='Offer Training For...')
tos = forms.BooleanField(initial=False, required=True)
class Meta: class Meta:
model = Attorney model = Attorney
fields = ['first_name', 'last_name', 'region', 'password1', 'password2', 'image', 'email', 'address', 'phone', 'website', 'call_to_bar', 'lso', 'biography', 'provide_training', 'request_training', 'case_law', 'newsletter'] fields = ['first_name', 'last_name', 'region', 'password1', 'password2', 'image', 'email', 'address', 'phone', 'website', 'call_to_bar', 'lso', 'biography', 'provide_training', 'request_training', 'case_law', 'newsletter', 'tos']
def clean(self): def clean(self):
cleaned_data = super().clean() cleaned_data = super().clean()

View File

@ -39,7 +39,7 @@
$('#reset-form').collapse('show'); $('#reset-form').collapse('show');
}); });
$('#reset').click(function() { $('#reset').click(function () {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{% url 'reset token' %}', url: '{% url 'reset token' %}',
@ -123,7 +123,7 @@
{{ register.address|add_class:"form-control"|attr:"placeholder:Address" }} {{ register.address|add_class:"form-control"|attr:"placeholder:Address" }}
</div> </div>
<div class="form-group col-4"> <div class="form-group col-4">
{{ register.region|add_class:"form-control"}} {{ register.region|add_class:"form-control" }}
</div> </div>
<div class="form-group col-12"> <div class="form-group col-12">
{{ register.website|add_class:"form-control"|attr:"placeholder:Website" }} {{ register.website|add_class:"form-control"|attr:"placeholder:Website" }}
@ -165,6 +165,17 @@
<div class="form-group col-12"> <div class="form-group col-12">
{{ register.request_training|add_class:"form-control"|attr:"placeholder:Training I would like to recieve..." }} {{ register.request_training|add_class:"form-control"|attr:"placeholder:Training I would like to recieve..." }}
</div> </div>
<div class="form-group col-12 my-3">
<div class="form-check">
{{ register.tos|add_class:"form-check-input" }} <label class="form-check-label">
I certify that I am a member in good standing of the Law Society of Ontario, practicing in
the field of defence side child protection law, or am a member of the Rights Panel with the
office of The Children's Lawyer, also practicing defence work, or am a law student, lawyer
representing a band or Native Organization, or a student completing articles under the
direction of one of the foregoing.
</label>
</div>
</div>
</div> </div>
<button class="btn btn-primary col-12 mb-2 p-2">Register</button> <button class="btn btn-primary col-12 mb-2 p-2">Register</button>
@ -176,7 +187,8 @@
<button id="reset" class="btn btn-primary col-12 mb-2 p-2">Reset</button> <button id="reset" class="btn btn-primary col-12 mb-2 p-2">Reset</button>
</div> </div>
<div id="reset-confirm" class="alert alert-success collapse">Instructions have been sent to your email.</div> <div id="reset-confirm" class="alert alert-success collapse">Instructions have been sent to your email.
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}