This commit is contained in:
Ross
2022-04-08 23:14:32 +01:00
parent 7183cbbc09
commit 11f3836e53
4 changed files with 192 additions and 90 deletions
+10 -38
View File
@@ -59,45 +59,17 @@
</details>
{% endif %}
{% if take %}
<form method="POST" class="post-form">{% csrf_token %}
<div class="form-contents">
{% if collection.publish_results %}<fieldset disabled="disabled">{% endif %}
{{form}}
{% if collection.publish_results %}</fieldset>{% endif %}
</div>
{% if previous > -1 %}
<button type="submit" name="previous" class="save btn btn-default">Previous</button>
{% endif %}
{% if next %}
<button type="submit" name="next" class="save btn btn-default">Next</button>
{% else %}
{% if not exam.publish_results %}
<button type="submit" name="save" class="save btn btn-default">Save</button>
{% endif %}
{% endif %}
<div>
{% if previous %}
<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=case_number|add:-1 %}">Previous</a>
{% endif %}
{% if next %}
<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=case_number|add:1 %}">Next</a>
{% endif %}
</div>
<br />
Return to <a href='{{collection.get_absolute_url}}'>collection</a>
{% if collection.publish_results %}
Answer score: {{answer.score}}<br />
Answer feedback: {{answer.feedback|safe}}
{% endif %}
<br />
<button type="submit" name="finish" class="save btn btn-default">Overview</button>
<button type="submit" id="goto-button" value="test" name="goto" class="hide">goto</button>
</form>
{% else %}
<div>
{% if previous %}
<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=case_number|add:-1 %}">Previous</a>
{% endif %}
{% if next %}
<a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=case_number|add:1 %}">Next</a>
{% endif %}
</div>
<br />
Return to <a href='{{collection.get_absolute_url}}'>collection</a>
{% endif %}
{% endblock %}
{% block js %}
@@ -0,0 +1,104 @@
{% extends 'atlas/base.html' %}
{% block content %}
<h2>Case {{case_number|add:1}}
{% if collection.show_title %}
: {{case.title}}
{% endif %}
</h2>
{% if collection.show_description and case.description%}
<div>
Description: {{case.description}}
</div>
{% endif %}
{% if collection.show_history and case.history%}
<div>
History: {{case.history}}
</div>
{% endif %}
<div class="pre-whitespace multi-image-block">
{% for series in series_list %}
<span class="series-block">
<span>
Series {{ forloop.counter }}:
<a href="#" onclick='window.loadDicomViewer(window.images[{{forloop.counter0}}])'>
{{series.get_block}}
</a>
</span>
</span>
{% endfor %}
</div>
<div>
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
</div>
</div>
{% if collection.show_discussion and case.discussion%}
<details>
<summary>
Discussion:
</summary>
<div>
{{case.discussion}}
</div>
</details>
{% endif %}
{% if collection.show_report and case.report%}
<details>
<summary>
Report:
</summary>
<div>
{{case.report}}
</div>
</details>
{% endif %}
<form method="POST" class="post-form">{% csrf_token %}
<div class="form-contents">
{% if collection.publish_results %}<fieldset disabled="disabled">{% endif %}
{{form}}
{% if collection.publish_results %}</fieldset>{% endif %}
</div>
{% if previous > -1 %}
<button type="submit" name="previous" class="save btn btn-default">Previous</button>
{% endif %}
{% if next %}
<button type="submit" name="next" class="save btn btn-default">Next</button>
{% else %}
{% if not exam.publish_results %}
<button type="submit" name="save" class="save btn btn-default">Save</button>
{% endif %}
{% endif %}
{% if collection.publish_results %}
Answer score: {{answer.score}}<br />
Answer feedback: {{answer.feedback|safe}}
{% endif %}
<br />
<button type="submit" name="finish" class="save btn btn-default">Overview</button>
<button type="submit" id="goto-button" value="test" name="goto" class="hide">goto</button>
</form>
{% endblock %}
{% block js %}
<script type="text/javascript">
window.images = {
{% for series in series_list %}
{{ forloop.counter0 }}: ["{{ series.get_image_url_array_not_json }}"],
{% endfor %}
}
$(document).ready(function () {
setTimeout(() => {
window.loadDicomViewer(window.images[0])
}, 500);
})
</script>
{% endblock js %}