diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js
index 25e7132a..579a101f 100644
--- a/anatomy/static/js/anatomy.js
+++ b/anatomy/static/js/anatomy.js
@@ -176,6 +176,37 @@ $(document).ready(function () {
});
+ // Table row selection
+ // Delegate click event to all table rows
+ document.querySelectorAll('.row-selector tbody tr').forEach(function(row) {
+ row.addEventListener('click', function(e) {
+ // Ignore clicks on links or checkboxes
+ if (e.target.tagName === 'A' || e.target.tagName === 'INPUT') return;
+
+ // Find the checkbox in this row
+ const checkbox = row.querySelector('input[name="selection"]');
+ if (checkbox) {
+ checkbox.checked = !checkbox.checked;
+ row.classList.toggle('selected', checkbox.checked);
+ }
+ });
+
+ // Keep row visually in sync with checkbox state (e.g. after page reload)
+ const checkbox = row.querySelector('input[name="selection"]');
+ if (checkbox && checkbox.checked) {
+ row.classList.add('selected');
+ }
+ // Also toggle row selection when checkbox is clicked directly
+ if (checkbox) {
+ checkbox.addEventListener('click', function(e) {
+ row.classList.toggle('selected', checkbox.checked);
+ // Prevent row click event from firing
+ e.stopPropagation();
+ });
+ }
+ });
+
+
});
window.loadDicomViewerEvent = new Event('loadDicomViewer');
@@ -482,6 +513,8 @@ async function setUpDicom(element) {
}
+window.setUpDicom = setUpDicom;
+
//function keyUpHandler(e) {
// if (e.key == "Control") {
// dicomViewer.registerPrimaryDicomInterface(e);
@@ -681,4 +714,5 @@ function initializeClock(id, endtime) {
updateClock();
}
-window.initializeClock = initializeClock
\ No newline at end of file
+window.initializeClock = initializeClock
+
diff --git a/atlas/tables.py b/atlas/tables.py
index f39e1156..e5976728 100755
--- a/atlas/tables.py
+++ b/atlas/tables.py
@@ -183,6 +183,8 @@ class CaseTable(tables.Table):
)
sequence = ("view", )
order_by = "-created_date"
+ attrs = {"class": "table row-selector"}
+
class PopupLinkColumn(tables.Column):
@@ -231,6 +233,8 @@ class SeriesTable(tables.Table):
)
sequence = ("view", "popup", "images", "case")
order_by = "-created_date"
+ attrs = {"class": "table row-selector"}
+
def __init__(self, data=None, *args, **kwargs):
super().__init__(
@@ -271,6 +275,8 @@ class ConditionTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ("primary", "subspecialty", "rcr_curriculum_map", "rcr_curriculum")
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
def __init__(self, data=None, *args, **kwargs):
super().__init__(
@@ -307,6 +313,8 @@ class FindingTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ("name", "primary")
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
@@ -334,6 +342,8 @@ class StructureTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ("name", "primary")
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
@@ -360,6 +370,8 @@ class PresentationTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ("name",)
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
class PathologicalProcessTable(tables.Table):
@@ -381,6 +393,8 @@ class PathologicalProcessTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ("name",)
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
class SubspecialtyTable(tables.Table):
@@ -402,6 +416,8 @@ class SubspecialtyTable(tables.Table):
template_name = "django_tables2/bootstrap4.html"
fields = ()
sequence = ("name",)
+ attrs = {"class": "table row-selector"}
+
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
@@ -436,6 +452,8 @@ class CaseCollectionTable(tables.Table):
"author",
)
sequence = ("view", )#, "series")
+ attrs = {"class": "table row-selector"}
+
def __init__(self, data=None, *args, **kwargs):
super().__init__(
@@ -463,6 +481,8 @@ class QuestionSchemaTable(tables.Table):
model = QuestionSchema
template_name = "django_tables2/bootstrap4.html"
fields = ("name", "description", "schema")
+ attrs = {"class": "table row-selector"}
+
def render_schema(self, value, record):
return format_html("Schema
{}