Skip to content

Commit

Permalink
student account
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Nov 2, 2023
1 parent efb9cca commit c66e0d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
23 changes: 21 additions & 2 deletions portal/static/portal/js/organisation_manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function hideDeleteAccountPopup() {
}

$(document).ready(() => {
$('#edit_account_details_password').on(
$('#edit_account_details_password, #student_account_form').on(
'click',
'#password-field-icon, #confirm-password-field-icon',
() => {
Expand All @@ -107,9 +107,28 @@ $(document).ready(() => {

$('#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);
}
);

$('#edit_account_details_password, #student_account_form').on(
'click',
'#current-password-field-icon',
() => {
let inputType;
let dataIcon = $('#current-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_current_password').attr('type', inputType);
$('#current-password-field-icon').attr('data-icon', dataIcon);
}
);
});
9 changes: 6 additions & 3 deletions portal/templates/portal/play/student_edit_account.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,23 @@ <h1 class="banner__text--primary">Welcome, {{ user|make_into_username }}</h1>
<div class="form--row__input col-md-4">
<div class="input--icon">
{{ form.password }}
<span class="iconify" data-icon="mdi:security"></span>
<span id="password-field-icon" class="iconify" data-icon="material-symbols:visibility-off"></span>
</div>
<small>{{ form.password.help_text }}</small>
{{ form.password.errors }}
</div>
<div class="form--row__input col-md-4">
{{ form.confirm_password }}
<div class="input--icon">
{{ form.confirm_password }}
<span id="confirm-password-field-icon" class="iconify" data-icon="material-symbols:visibility-off"></span>
</div>
<small>{{ form.confirm_password.help_text }}</small>
{{ form.confirm_password.errors }}
</div>
<div class="form--row__input col-md-4">
<div class="input--icon">
{{ form.current_password }}
<span class="iconify" data-icon="mdi:security"></span>
<span id="current-password-field-icon" class="iconify" data-icon="material-symbols:visibility-off"></span>
</div>
<small>{{ form.current_password.help_text }}</small>
{{ form.current_password.errors }}
Expand Down

0 comments on commit c66e0d9

Please sign in to comment.