Added drop-down to user create and update modal

This commit is contained in:
2025-11-01 16:11:01 +01:00
parent c89cb29dc3
commit 4b5fc03cad

View File

@@ -203,7 +203,9 @@
<h6 class="fw-bold">@T["Workplace & account"]</h6>
<div class="col-md-6">
<label class="form-label">@T["Workplace"]</label>
<input type="text" id="updateWorkplace" name="Description.Workplace" class="form-control" />
<select class="form-select" id="updateWorkplace" name="Description.Workplace">
<option value="">@T["Select location"]</option>
</select>
</div>
<div class="col-md-6">
<label class="form-label">@T["Groups"]</label>
@@ -374,7 +376,9 @@
updateForm.querySelector('#updateTitle').value = title || '';
updateForm.querySelector('#updateName').value = name || '';
updateForm.querySelector('#updateSurname').value = surname || '';
updateForm.querySelector('#updateWorkplace').value = workplace || '';
let updateWorkplaceElement = updateForm.querySelector('#updateWorkplace');
await loadLocationsIntoSelect(updateWorkplaceElement);
updateWorkplaceElement.value = workplace || '';
updateForm.querySelector('#updatePassword').value = '';
updateForm.querySelector('#updateJpegPhoto').value = '';
@@ -484,7 +488,9 @@
<h6 class="fw-bold">@T["Workplace & account"]</h6>
<div class="col-md-6">
<label class="form-label">@T["Workplace"]</label>
<input type="text" name="Description.Workplace" class="form-control" />
<select class="form-select" name="Description.Workplace">
<option value="">@T["Select location"]</option>
</select>
</div>
<div class="col-md-6">
<label class="form-label">@T["Groups"]</label>
@@ -526,6 +532,10 @@
createModal.addEventListener('show.bs.modal', async () => {
await populateGroupsDropdown(createGroupsSelect);
createForm.reset();
let createWorkplaceElement = createForm.querySelector('[name="Description.Workplace"]');
await loadLocationsIntoSelect(createWorkplaceElement);
createWorkplaceElement.value = '';
photoPreview.style.display = 'none';
});