From 97d65f0caa8a0b894801b948586a7464368b1da4 Mon Sep 17 00:00:00 2001 From: Ross Date: Fri, 14 Nov 2025 21:48:06 +0000 Subject: [PATCH] Refactor series viewer template for improved layout and usability; enhance findings display and action buttons --- atlas/templates/atlas/series_viewer.html | 399 +++++++++++------------ 1 file changed, 193 insertions(+), 206 deletions(-) diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index 1f20800f..9a2a1cd1 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -1,225 +1,210 @@ {% load crispy_forms_tags %} - -
{{ series.modality}}, {{ series.examination }}, {{ series.plane }}, {{ series.contrast }}
-
Description: {{series.description}}
- -Associated case: -{% for case in series.case.all %} - - {{case}} - {% if can_edit %} - - {% endif %} - -{% empty %} - This series is not associated with any cases. - {% if can_edit %} -
- Add Series to Case -
- {% csrf_token %} - - - -
-
-
- {% endif %} -{% endfor %} -
Author: {{ series.get_author_display }}
- {% with image_url_array_and_count=series.get_image_url_array_and_count %} -{% comment %}
-
{% endcomment %} -
- - - {% if can_edit %} - {% if editing_finding < 1 %} - - - {% endif %} - -
-
- {% if editing_finding > 0 %} -

Editing Finding

-

Editing finding with ID: {{editing_finding}}

- {% else %} -

Add Finding

-

Click the button below to add a new finding.

- {% endif %} -
- {% csrf_token %} - {{series_finding_form|crispy}} - - -
+
+
+
+
+
+
+

Series: {{ series.modality }} - {{ series.examination }}

+
{{ series.plane }}, {{ series.contrast }}
+
Description: {{ series.description }}
+
Author: {{ series.get_author_display }}
+
+
+ View series + {% if can_edit %} + + {% else %} + + {% endif %} +
+
- {% else %} - - {% endif %} +
-
- Findings +
+
+
+
+ {% with image_url_array_and_count=series.get_image_url_array_and_count %} +
+
+ {% endwith %} +
+ +
- {% for finding in series.findings.all %} -
- +
+
+ Findings +
+ {% for finding in series.findings.all %} +
+
+
+ + Finding(s): + {% for f in finding.findings.all %}{{f.get_link}}{% endfor %}
+ Structure(s): {% for s in finding.structures.all %}{{s.get_link}}{% endfor %}
+ Condition(s): {% for s in finding.conditions.all %}{{s.get_link}}{% endfor %}
+
{{finding.description}}
+
+
+ {% if request.user.is_superuser %} + +
+
{{finding.annotation_json}}
+
{{finding.viewport_json}}
+
+ {% endif %} + {% if can_edit %} +
+ Edit + Delete +
+ {% endif %} +
+
+
+ {% empty %} +

No findings available.

+ {% endfor %} +
+
+
+
- - Finding(s): {% for f in finding.findings.all %}{{f.get_link}}{% endfor %}
- Structure(s): {% for s in finding.structures.all %}{{s.get_link}}{% endfor %}
- Condition(s): {% for s in finding.conditions.all %}{{s.get_link}}{% endfor %}
- Description: {{finding.description}}
+
+
+
Cases
+
+
    + {% for case in series.case.all %} + + {% empty %} +
  • This series is not associated with any cases.
  • + {% if can_edit %} +
  • +
    + Add Series to Case +
    + {% csrf_token %} +
    + + +
    + +
    +
    +
    +
  • + {% endif %} + {% endfor %} +
+
+
- {% if request.user.is_superuser %} - + -
- - {% if can_edit %} -
- Truncate series -

- This will limit the series to the selected bounds (the rest of the images will be deleted). This is useful when you have a large volume of which only a small area is relevant to the case. NOTE: once deleted the images cannot be recovered on the site (they would have to be reuploaded if required). Make sure your images are shown in the correct order above and use test the test truncate button first. -

- +
- Start
- End
- - -
- - - {% endif %} -{% endwith %} - - - -{% if can_edit %} -
- Series info -
- - - - - - + {% if can_edit %} +
+
Truncate series
+
+

Limit the series to the selected bounds (the rest of the images will be deleted). This action is irreversible on site.

+
Warning: If you have reordered the series this may remove the wrong images.
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ + +
+
+
+
+ {% endif %}
-
- - Image details - -
- {% for image in series.get_images %} - [{{ image.id }}] {{image.image.url}}, pos: {{image.position}}, {{image.upload_filename}} - {% if image.image %} - [{{image.get_file_size|filesizeformat}}] - {% endif %} - {{image.image_md5_hash}} ({{image.is_dicom}}) {{image.image_blake3_hash}} - -
- {% endfor %} - -
- - - show all diff - -
- -

Total image size: {{series.get_total_image_size|filesizeformat}}

-

- -

-
-{% endif %} +
+ -