diff --git a/portal/static/portal/js/teacherEditStudent.js b/portal/static/portal/js/teacherEditStudent.js new file mode 100644 index 000000000..b67deacc6 --- /dev/null +++ b/portal/static/portal/js/teacherEditStudent.js @@ -0,0 +1,23 @@ +$(document).ready(() => { + $('#edit-student-password-form').on( + 'click', + '#password-field-icon, #confirm-password-field-icon', + () => { + let inputType; + let dataIcon = $('#password-field-icon').attr('data-icon'); + if (dataIcon === 'material-symbols:visibility') { + inputType = 'password'; + dataIcon = 'material-symbols:visibility-off'; + } else { + inputType = 'text'; + dataIcon = 'material-symbols:visibility'; + } + + $('#id_password').attr('type', inputType); + $('#id_confirm_password').attr('type', inputType); + + $('#password-field-icon').attr('data-icon', dataIcon); + $('#confirm-password-field-icon').attr('data-icon', dataIcon); + } + ); +}); \ No newline at end of file diff --git a/portal/templates/portal/teach/teacher_edit_student.html b/portal/templates/portal/teach/teacher_edit_student.html index 17ee71702..76d6e43f6 100644 --- a/portal/templates/portal/teach/teacher_edit_student.html +++ b/portal/templates/portal/teach/teacher_edit_student.html @@ -1,4 +1,5 @@ {% extends 'portal/base.html' %} +{% load static %} {% block subNav %} {% include "portal/partials/teacher_non_dashboard_subnav.html" %} @@ -39,7 +40,7 @@
You can set this student's password. Setting the password will also regenerate their direct access link.
-