numerous updates to case collections

This commit is contained in:
Ross
2024-02-12 13:05:26 +00:00
parent c3f7913402
commit b9cdbb98ef
10 changed files with 158 additions and 29 deletions
@@ -0,0 +1,13 @@
<span id="add-case-form">
<form hx-post="{% url 'atlas:add_case_to_collection' collection.id %}" hx-swap="outerHTML">
{% csrf_token %}
<label for="case">Select Case:</label>
<select name="case" id="case">
{% for case in cases %}
<option value="{{ case.id }}">{{ case.title }}</option>
{% endfor %}
</select>
<button type="submit">Add</button>
<button _="on click remove #add-case-form">Cancel</button>
</form>
</span
+1 -1
View File
@@ -53,7 +53,7 @@
Use this form to create a atlas case. Existing associated image sets can be added using this form.
{% if form.collection %}
<div class="alert alert-info" role="alert">Creating a case in the collection: <a href="{% url 'atlas:collection_detail' pk=form.exam.pk %}">{{form.collection.name}}</a></div>
<div class="alert alert-info" role="alert">Creating a case in the collection: <a href="{% url 'atlas:collection_detail' pk=form.collection.pk %}">{{form.collection.name}}</a></div>
{% endif %}
<form action="" method="post" enctype="multipart/form-data" id="atlas-form">
{% csrf_token %}
@@ -28,29 +28,42 @@
</div>
{% endif %}
<div class="pre-whitespace multi-image-block">
<details open>
<summary>
Images
</summary>
{% for series in series_list %}
<span class="series-block">
<a href="#" onclick='window.loadDicomViewer(window.images[{{forloop.counter0}}])'>
<span>
<span class="series-block-series-number">Series {{ forloop.counter }}:</span>
{{series.get_block}}
</span>
</a>
</span>
{% endfor %}
</details>
</div>
<div>
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
{% if collection.show_ohif_viewer_link %}
<div>
<a href="https://viewer.penracourses.org.uk/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">View case in OHIF</a>
</div>
{% endif %}
{% if collection.show_built_in_viewer %}
<div class="pre-whitespace multi-image-block">
<details open>
<summary>
Images
</summary>
{% for series in series_list %}
<span class="series-block">
<a href="#" onclick='window.loadDicomViewer(window.images[{{forloop.counter0}}])'>
<span>
<span class="series-block-series-number">Series {{ forloop.counter }}:</span>
{{series.get_block}}
</span>
</a>
</span>
{% endfor %}
</details>
</div>
</div>
<div>
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
</div>
</div>
{% else %}
{% endif %}
{% if show_discussion and case.discussion %}
<p>
<details>
+7 -1
View File
@@ -21,8 +21,14 @@
<p>This collection will be available to view/take <a href='{{collection.get_take_url}}'>here</a>
{% if can_edit %}
<p><button id='button-edit-order' title='click and drag questions to change order' data-posturl="{% url 'atlas:exam_json_edit' pk=collection.pk %}">Edit case order / Delete cases</button></p>
<p><button id='button-add-case'
title='click to add a case to this collection'
hx-get="{% url 'atlas:add_case_to_collection' collection.pk %}" hx-swap="innerHTML" hx-target="#case-list">
Add case
</button>
<div id='case-list'></div>
</p>
{% endif %}
{% include 'exam_overview_js.html' %}
{% endblock %}
@@ -7,12 +7,15 @@
<h2>Collection: {{collection.name}}
{% if collection.publish_results or cid_user_exam.completed %}
{% if collection.in_review_mode or cid_user_exam.completed %}
<span class="stamp-white">REVIEW</span>
{% endif %}
</h2>
{{answer_count}} out of {{collection_length}} cases answered. Click to go to case.
{% if not collection.review_only %}
{{answer_count}} out of {{collection_length}} cases answered. Click to go to case.
{% endif %}
<div class="sba-finish-list">
<ul>
{% for question, answer, self_review in question_answer_tuples %}
@@ -40,9 +43,8 @@
</ul>
</div>
Start time: {{cid_user_exam.start_time}}
{% if collection.self_review %}
<p>Completed: <span id="completed-state">{{cid_user_exam.completed}}</span></p>
@@ -3,6 +3,8 @@
{% block content %}
<h2>Collections</h2>
The following collections are available for you to view / take.
<ul>
{% for collection in collections %}