From 5bf00950383bb338478e49ccee70cd767a09cde5 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 14 Feb 2024 18:25:43 +0000 Subject: [PATCH] show case details in viva vew --- atlas/models.py | 12 ++ atlas/templates/atlas/collection_viva.html | 121 ++++++++++++--------- 2 files changed, 81 insertions(+), 52 deletions(-) diff --git a/atlas/models.py b/atlas/models.py index 6a52aeec..8dc94dbe 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -415,6 +415,18 @@ class Case(models.Model, AuthorMixin): } pass + def get_viva_details(self): + return { + "title": self.title, + "description": self.description, + "history": self.history, + "discussion": self.discussion, + "report": self.report, + } + + def get_viva_details_json(self): + return json.dumps(self.get_viva_details()) + def extract_image_dicom_json_from_ds(ds, url, image_index): to_keep = [ diff --git a/atlas/templates/atlas/collection_viva.html b/atlas/templates/atlas/collection_viva.html index 14b78680..a457a6e4 100644 --- a/atlas/templates/atlas/collection_viva.html +++ b/atlas/templates/atlas/collection_viva.html @@ -1,52 +1,64 @@ {% extends 'atlas/exams.html' %} {% block content %} -

Cases

Instructions

Click on the 'Show' button to view the case in the viewer. Click on the 'Open' button to open the case in a new window.

Opening a second case will replace the first case in the viewer or window.

It is also possible to open a single series in the viewer or window by clicking on the 'Show' or 'Open' button next to the series.

- {% comment %} {% endcomment %} - -
    - {% for case in cases %} -
  1. -
    Case {{forloop.counter}}: {{case.title}}   - +
    +
    +
    +

    Cases

    +
      + {% for case in cases %} +
    1. +
      Case {{forloop.counter}}: {{case.title}}   + {% comment %} {% endcomment %} {% comment %} {% endcomment %} - -
      -
      -
      Series: - {% for series in case.series.all %} - - - Series {{ forloop.counter }}:
      - {{series.get_block}} -
      - - -
      -
      -
      - {% endfor %} -
      -
      + +
      +
      +
      Series: + {% for series in case.series.all %} + + + Series {{ forloop.counter }}:
      + {{series.get_block}} +
      +{% comment %} {% endcomment %} + +
      +
      +
      + {% endfor %} +
      +
      +
      +
    2. + + {% endfor %} +
    +
    +
    + +
    +

    Currently showing

    +
    +
    +
    +
    +
    -
  2. - - {% endfor %} -
- -

-