Skip to content

Commit

Permalink
Fixed teacher invitation password visibility and strength checker
Browse files Browse the repository at this point in the history
  • Loading branch information
besque committed Oct 25, 2024
1 parent 0de63e9 commit ed339b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions portal/forms/teach.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


class InvitedTeacherForm(forms.Form):
prefix = 'teacher_signup'
teacher_password = forms.CharField(
help_text="Enter a password",
widget=forms.PasswordInput(
Expand Down
22 changes: 15 additions & 7 deletions portal/templates/portal/teach/invited.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h4>Complete registration</h4>
</p>
</div>

<form class="d-flex flex-column" method="post" id="form-invited-teacher" autocomplete="off">
<form class="d-flex flex-column" method="post" id="teacher-register-form" autocomplete="off">

{% csrf_token %}

Expand All @@ -29,15 +29,19 @@ <h4>Complete registration</h4>
<div class="row form--row">
<label for="{{ invited_teacher_form.teacher_password.auto_id }}"></label>
<div class="input--icon">
{{ invited_teacher_form.teacher_password }}<span class="iconify" data-icon="mdi:security"></span>
{{ invited_teacher_form.teacher_password }}
<span id="teacher-password-field-icon" class="iconify"
data-icon="material-symbols:visibility-off" ></span>
</div>
<small>{{ invited_teacher_form.teacher_password.help_text }}</small>
{{ invited_teacher_form.teacher_password.errors }}
</div>
<div class="row form--row">
<label for="{{ invited_teacher_form.teacher_confirm_password.auto_id }}"></label>
<div class="input--icon">
{{ invited_teacher_form.teacher_confirm_password }}<span class="iconify" data-icon="mdi:security"></span>
{{ invited_teacher_form.teacher_confirm_password }}
<span id="teacher-confirm-password-field-icon" class="iconify"
data-icon="material-symbols:visibility-off" ></span>
</div>
<small>{{ invited_teacher_form.teacher_confirm_password.help_text }}</small>
{{ invited_teacher_form.teacher_confirm_password.errors }}
Expand Down Expand Up @@ -73,10 +77,14 @@ <h4>Complete registration</h4>
</div>
</div>

<script type="text/javascript" src="{% static 'portal/js/passwordStrength.js' %}"></script>
{% include "portal/partials/service_unavailable_popup.html" %}

<script>
var TEACHER_PASSWORD_FIELD_ID = '{{ invited_teacher_form.teacher_password.auto_id }}';
var INDEP_STUDENT_PASSWORD_FIELD_ID = '{{ invited_teacher_form.teacher_password.auto_id }}';
const password_id = '{{ invited_teacher_form.teacher_password.auto_id }}';
var TEACHER_PASSWORD_FIELD_ID = password_id;
var INDEP_STUDENT_PASSWORD_FIELD_ID = password_id;
</script>

{% endblock content %}
<script type="text/javascript" src="{% static 'portal/js/passwordStrength.js' %}"></script>

{% endblock content %}

0 comments on commit ed339b9

Please sign in to comment.