diff --git a/atlas/tables.py b/atlas/tables.py
index 491980dc..457a79ee 100755
--- a/atlas/tables.py
+++ b/atlas/tables.py
@@ -35,11 +35,44 @@ class CaseTable(tables.Table):
"series__examination", # ForeignKey in the related model
"series__plane", # ForeignKey in the related model
"series__images", # Reverse relationship
+ "previous_case", # Prefetch the previous case relationship
+ #"next_case", # Prefetch the next case relationship
),
*args,
**kwargs,
)
+ def render_title(self, value, record):
+ return value
+
+ def render_description(self, value):
+ max_length = 50 # Set the maximum length for truncation
+ if len(value) > max_length:
+ truncated_value = f"{value[:max_length]}..." # Truncate and add ellipsis
+ else:
+ truncated_value = value
+ # Add a tooltip with the full text
+ return format_html(
+ '{}',
+ value, # Full text for the tooltip
+ truncated_value, # Truncated text for display
+ )
+
+ def render_series(self, value):
+ max_length = 50 # Set the maximum length for truncation
+ series_list = [str(series) for series in value.all()]
+ full_text = ", ".join(series_list) # Full text for the tooltip
+ if len(full_text) > max_length:
+ truncated_text = f"{full_text[:max_length]}..." # Truncate and add ellipsis
+ else:
+ truncated_text = full_text
+ # Add a tooltip with the full text
+ return format_html(
+ '{}',
+ full_text, # Full text for the tooltip
+ truncated_text, # Truncated text for display
+ )
+
def get_view_cell(record):
if record.open_access:
return format_html(f"""