mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Fixed user not clickable after creation, fixed missing data attributes for created user
This commit is contained in:
@@ -586,6 +586,10 @@
|
||||
data-user-title="${data.Title || ''}"
|
||||
data-user-name="${data.Cn || ''}"
|
||||
data-user-surname="${data.Sn || ''}"
|
||||
data-user-birthdate="${data.BirthDate}"
|
||||
data-user-address-city="${data.Description.Address.City}"
|
||||
data-user-address-street="${data.Description.Address.Street}"
|
||||
data-user-address-streetnr="${data.Description.Address.StreetNr}"
|
||||
data-user-workplace="${data.Description?.Workplace || ''}"
|
||||
data-user-groups='${JSON.stringify(data.Description?.Groups || [])}'
|
||||
data-bs-toggle="modal"
|
||||
@@ -602,6 +606,9 @@
|
||||
</div>
|
||||
</td>
|
||||
`;
|
||||
newRow.setAttribute("data-asset-id", result.Uid);
|
||||
newRow.classList.toggle("user-row");
|
||||
registerRowDetailviewClick(newRow);
|
||||
tbody.appendChild(newRow);
|
||||
} else {
|
||||
showToast(`${result.Exception || '@T["Create failed"]'}`, 'danger');
|
||||
@@ -699,10 +706,12 @@
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const rows = document.querySelectorAll('table tbody tr');
|
||||
|
||||
rows.forEach(row => registerRowDetailviewClick(row));
|
||||
});
|
||||
function registerRowDetailviewClick(row) {
|
||||
const detailModalEl = document.getElementById('detailModal');
|
||||
const detailModal = new bootstrap.Modal(detailModalEl);
|
||||
|
||||
rows.forEach(row => {
|
||||
row.addEventListener('click', (e) => {
|
||||
// Don’t trigger when clicking inside the action buttons
|
||||
if (e.target.closest('button')) return;
|
||||
@@ -743,8 +752,7 @@
|
||||
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
|
||||
detailModal.show();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user