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-title="${data.Title || ''}"
|
||||||
data-user-name="${data.Cn || ''}"
|
data-user-name="${data.Cn || ''}"
|
||||||
data-user-surname="${data.Sn || ''}"
|
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-workplace="${data.Description?.Workplace || ''}"
|
||||||
data-user-groups='${JSON.stringify(data.Description?.Groups || [])}'
|
data-user-groups='${JSON.stringify(data.Description?.Groups || [])}'
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
@@ -602,6 +606,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
`;
|
`;
|
||||||
|
newRow.setAttribute("data-asset-id", result.Uid);
|
||||||
|
newRow.classList.toggle("user-row");
|
||||||
|
registerRowDetailviewClick(newRow);
|
||||||
tbody.appendChild(newRow);
|
tbody.appendChild(newRow);
|
||||||
} else {
|
} else {
|
||||||
showToast(`${result.Exception || '@T["Create failed"]'}`, 'danger');
|
showToast(`${result.Exception || '@T["Create failed"]'}`, 'danger');
|
||||||
@@ -699,10 +706,12 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const rows = document.querySelectorAll('table tbody tr');
|
const rows = document.querySelectorAll('table tbody tr');
|
||||||
|
|
||||||
|
rows.forEach(row => registerRowDetailviewClick(row));
|
||||||
|
});
|
||||||
|
function registerRowDetailviewClick(row) {
|
||||||
const detailModalEl = document.getElementById('detailModal');
|
const detailModalEl = document.getElementById('detailModal');
|
||||||
const detailModal = new bootstrap.Modal(detailModalEl);
|
const detailModal = new bootstrap.Modal(detailModalEl);
|
||||||
|
|
||||||
rows.forEach(row => {
|
|
||||||
row.addEventListener('click', (e) => {
|
row.addEventListener('click', (e) => {
|
||||||
// Don’t trigger when clicking inside the action buttons
|
// Don’t trigger when clicking inside the action buttons
|
||||||
if (e.target.closest('button')) return;
|
if (e.target.closest('button')) return;
|
||||||
@@ -743,8 +752,7 @@
|
|||||||
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
|
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
|
||||||
detailModal.show();
|
detailModal.show();
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user