From 56a644c5c1a6aebb8facfc432244512ad81d4065 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 27 Apr 2026 23:11:57 +0100 Subject: [PATCH] fix: Correct indentation for hx-include attribute in case search widget --- atlas/templates/atlas/case_display_block.html | 98 ++----------------- .../atlas/partials/case_search_widget.html | 2 +- 2 files changed, 7 insertions(+), 93 deletions(-) diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 9f514fdc..de1cc590 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -474,7 +474,6 @@
Move selected series to another case - aaoecuthsaoehntu {% if move_series_form %}
{{ move_series_form.destination_case }} @@ -530,38 +529,6 @@ submitBtn.disabled = !hiddenInput.value; } - function selectFromRow(row) { - if (!row) return; - const casePk = row.getAttribute('data-case-pk'); - const caseTitleEl = row.querySelector('h6'); - const caseTitle = caseTitleEl ? caseTitleEl.textContent.trim() : ('Case #' + casePk); - applyMoveCaseSelection(casePk, caseTitle); - } - - // Hard fallback: capture-phase click listener scoped to this widget results. - document.addEventListener('click', function (e) { - try { - const row = e.target.closest('#move-series-case-search-results .list-group-item[data-case-pk]'); - if (!row) return; - if (e.target.closest('a,button,form,input')) return; - selectFromRow(row); - } catch (err) { - console.error('Move series capture click handler error', err); - } - }, true); - - // Mirror uploads-style delegated click handling directly on rows. - document.body.addEventListener('click', function (e) { - try { - const item = e.target.closest('#move-series-case-search-results .list-group-item[data-case-pk]'); - if (!item) return; - if (e.target.closest('a,button,form,input')) return; - selectFromRow(item); - } catch (err) { - console.error('Move series row click handler error', err); - } - }); - document.body.addEventListener('case:selected', function (e) { try { const detail = e.detail || {}; @@ -1117,62 +1084,6 @@ detailsElement.addEventListener("toggle", toggleCheckboxes); } - const modal = new bootstrap.Modal(document.getElementById("findingModal")); - const modalBody = document.getElementById("findingModalBody"); - - document.querySelectorAll(".view-finding-modal").forEach(button => { - button.addEventListener("click", function () { - const findingId = this.getAttribute("data-finding-id"); - const seriesId = this.getAttribute("data-series-id"); - - // Show loading text - modalBody.innerHTML = "

Loading...

"; - - // Fetch the finding details (replace with your actual endpoint) - fetch(`/atlas/series_finding/${findingId}/details/`) - .then(response => response.text()) - .then(html => { - modalBody.innerHTML = html; // Load the fetched HTML into the modal body - load_3d = false; - viewer_element_3d = document.getElementById('root'); - if (viewer_element_3d.dataset.viewerstate3d != undefined) { - load_3d = true; - viewerState = JSON.parse(viewer_element_3d.dataset.viewerstate3d || {}); - annotationjson3d = JSON.parse(viewer_element_3d.dataset.annotationjson3d || {}); - } else { - viewer_element_3d = null; - } - // Initialize viewer deterministically after injecting HTML - (async function(){ - try { - await mountDicomViewersSafely(); - if (load_3d) { - console.log("loading 3d"); - // deferred 3D import can be handled here if needed - } else { - console.log("not loading 3d"); - } - } catch(e){ - console.warn('Viewer init error:', e); - } - })(); - - document.getElementById("reload-finding").addEventListener("click", function () { - mountDicomViewersSafely(); - }); - - // Initialize the DICOM viewer with the images and annotations - }) - .catch(error => { - console.error("Error loading finding details:", error); - modalBody.innerHTML = "

Failed to load finding details.

"; - }); - - // Show the modal - modal.show(); - }); - }); - // Display Set modal handler const dsModal = new bootstrap.Modal(document.getElementById("displaysetModal")); const dsModalBody = document.getElementById("displaysetModalBody"); @@ -1319,7 +1230,8 @@ document.querySelectorAll(".view-finding-modal").forEach(button => { button.addEventListener("click", function () { const findingId = this.getAttribute("data-finding-id"); - try { setUrlParam('finding', findingId); } catch (e) {} + const url = this.getAttribute('data-url'); + loadFindingModal(findingId, url); }); }); document.getElementById('findingModal').addEventListener('hidden.bs.modal', function () { @@ -1427,8 +1339,10 @@ } .series-actions summary { list-style: none; } .series-actions summary::-webkit-details-marker { display:none; } - .series-actions .btn { vertical-align: middle; } - .series-actions .btn { text-align: left; } + .series-actions .btn { + vertical-align: middle; + text-align: left; + } @media (prefers-color-scheme: dark) { .series-actions { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.04); } } diff --git a/atlas/templates/atlas/partials/case_search_widget.html b/atlas/templates/atlas/partials/case_search_widget.html index 5d19faa1..30c96ede 100644 --- a/atlas/templates/atlas/partials/case_search_widget.html +++ b/atlas/templates/atlas/partials/case_search_widget.html @@ -10,7 +10,7 @@