Skip to content

Commit

Permalink
teacher account
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Nov 2, 2023
1 parent 0095434 commit efb9cca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions portal/static/portal/js/organisation_manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,27 @@ function showDeleteAccountConfirmation(delete_password, unsubscribe_newsletter,
function hideDeleteAccountPopup() {
$("#popup-delete-review").removeClass("popup--fade");
}

$(document).ready(() => {
$('#edit_account_details_password').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);
}
);
});
3 changes: 2 additions & 1 deletion portal/templates/portal/teach/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,15 @@ <h4>Your account</h4>
<div class="form--row__input col-sm-6 col-md-4">
<div class="input--icon">
{{ update_account_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>{{ update_account_form.password.help_text }}</small>
{{ update_account_form.password.errors }}
</div>
<div class="form--row__input col-sm-6 col-md-4">
<div class="input--icon">
{{ update_account_form.confirm_password }}
<span id="confirm-password-field-icon" class="iconify" data-icon="material-symbols:visibility-off"></span>
</div>
<small>{{ update_account_form.confirm_password.help_text }}</small>
{{ update_account_form.confirm_password.errors }}
Expand Down

0 comments on commit efb9cca

Please sign in to comment.