mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 15:01:56 +00:00
Added location dropdown selection for Assets view
This commit is contained in:
@@ -171,7 +171,9 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">@T["Location"]</label>
|
||||
<input type="text" class="form-control" name="Location" />
|
||||
<select class="form-select" name="Location" id="createLocationSelect">
|
||||
<option value="">@T["Select location"]</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">@T["Owner"]</label>
|
||||
@@ -373,7 +375,6 @@
|
||||
<form id="updateAssetForm">
|
||||
<div class="modal-body">
|
||||
<div class="row g-3">
|
||||
<!-- Same fields as in Create -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">@T["Name"]</label>
|
||||
<input type="text" class="form-control" name="Name" />
|
||||
@@ -381,7 +382,9 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">@T["Location"]</label>
|
||||
<input type="text" class="form-control" name="Location" />
|
||||
<select class="form-select" name="Location" id="updateLocationSelect">
|
||||
<option value="">@T["Select location"]</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">@T["Owner"]</label>
|
||||
@@ -482,7 +485,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
updateAttributesContainer.innerHTML = '';
|
||||
updateForm.reset();
|
||||
|
||||
const locationSelect = updateForm.querySelector('#updateLocationSelect');
|
||||
await loadLocationsIntoSelect(locationSelect);
|
||||
try {
|
||||
const response = await fetch(`/Assets/Get?cn=${assetId}`);
|
||||
const responseJson = await response.json();
|
||||
@@ -754,6 +758,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const createModal = document.getElementById('createAssetModal');
|
||||
createModal.addEventListener('show.bs.modal', async () => {
|
||||
const select = createModal.querySelector('#createLocationSelect');
|
||||
await loadLocationsIntoSelect(select);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<partial name="_Batch"/>
|
||||
Reference in New Issue
Block a user