Skip to content

Commit

Permalink
Minor improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
leepeuker committed Apr 11, 2023
1 parent 0960570 commit 8df8576
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions public/js/settings-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function prepareCreateUserModal(name) {
document.getElementById('userModalPasswordInput').value = ''
document.getElementById('userModalRepeatPasswordInput').value = ''
document.getElementById('userModalIsAdminInput').checked = ''

// Remove class invalid-input from all (input) elements
Array.from(document.querySelectorAll('.invalid-input')).forEach((el) => el.classList.remove('invalid-input'));
}

function prepareEditUserModal(id, name, email, isAdmin, password, repeatPassword) {
Expand All @@ -63,6 +66,9 @@ function prepareEditUserModal(id, name, email, isAdmin, password, repeatPassword
document.getElementById('userModalIsAdminInput').checked = isAdmin
document.getElementById('userModalPasswordInput').value = ''
document.getElementById('userModalRepeatPasswordInput').value = ''

// Remove class invalid-input from all (input) elements
Array.from(document.querySelectorAll('.invalid-input')).forEach((el) => el.classList.remove('invalid-input'));
}

function validateCreateUserInput() {
Expand Down
4 changes: 2 additions & 2 deletions templates/component/modal-user.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<div class="mb-3">
<label for="userModalPasswordInput" class="form-label">Password <span class="text-danger" id="userModalPasswordInputRequiredStar">*</span></label>
<input type="password" class="form-control" id="userModalPasswordInput" minlength="8" required>
<div id="userModalPasswordInput" class="form-text">Must be at least 8 characters long and match repeated</div>
<div id="userModalPasswordInput" class="form-text">Must be at least 8 characters long</div>
</div>
<div class="mb-3">
<label for="userModalRepeatPasswordInput" class="form-label">Repeat Password <span class="text-danger" id="userModalRepeatPasswordInputRequiredStar">*</span></label>
<input type="password" class="form-control" id="userModalRepeatPasswordInput" minlength="8" required>
<div id="userModalRepeatPasswordInput" class="form-text">Must be at least 8 characters long and match repeated</div>
<div id="userModalRepeatPasswordInput" class="form-text">Must match entered password</div>
</div>
<div class="mb-3">
<div class="form-check">
Expand Down

0 comments on commit 8df8576

Please sign in to comment.