From 5c50ee75dae10f81e9752708a9cc121e75930489 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 13 Apr 2026 14:07:54 +0100 Subject: [PATCH] Add post-exam display options to CaseCollection model and update template --- atlas/forms.py | 3 ++ ...collection_show_case_link_post_and_more.py | 28 +++++++++++++++++++ atlas/models.py | 12 ++++++++ .../atlas/collection_case_view_take.html | 12 +++++++- 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 atlas/migrations/0095_casecollection_show_case_link_post_and_more.py diff --git a/atlas/forms.py b/atlas/forms.py index 40c2129d..c42a45df 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -227,6 +227,9 @@ class CaseCollectionForm(ModelForm): "show_description_post", "show_discussion_post", "show_report_post", + "show_case_link_post", + "show_findings_post", + "show_displaysets_post", ] if f in self.fields ] diff --git a/atlas/migrations/0095_casecollection_show_case_link_post_and_more.py b/atlas/migrations/0095_casecollection_show_case_link_post_and_more.py new file mode 100644 index 00000000..84775362 --- /dev/null +++ b/atlas/migrations/0095_casecollection_show_case_link_post_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2026-04-13 13:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0094_apitoken'), + ] + + operations = [ + migrations.AddField( + model_name='casecollection', + name='show_case_link_post', + field=models.BooleanField(default=False, help_text='Show a link to the case (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_displaysets_post', + field=models.BooleanField(default=False, help_text='Show display sets for the case (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_findings_post', + field=models.BooleanField(default=False, help_text='Show findings related to the case (post exam)'), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index e0837f27..a97eb8e7 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -1293,6 +1293,18 @@ class CaseCollection(ExamOrCollectionGenericBase): default=False, help_text="Show the case report (post exam)" ) + # New post-exam display options + show_case_link_post = models.BooleanField( + default=False, help_text="Show a link to the case (post exam)" + ) + show_findings_post = models.BooleanField( + default=False, help_text="Show findings related to the case (post exam)" + ) + show_displaysets_post = models.BooleanField( + default=False, help_text="Show display sets for the case (post exam)" + ) + + author = models.ManyToManyField( settings.AUTH_USER_MODEL, blank=True, diff --git a/atlas/templates/atlas/collection_case_view_take.html b/atlas/templates/atlas/collection_case_view_take.html index 0232b3c0..2cf81a27 100644 --- a/atlas/templates/atlas/collection_case_view_take.html +++ b/atlas/templates/atlas/collection_case_view_take.html @@ -177,6 +177,17 @@ {% endif %} {% if question_completed %} + + {% if collection.show_case_link_post %} +
+ Open case +
+ {% endif %} + + {% if collection.show_findings_post or collection.show_displaysets_post %} + {% include 'atlas/case_display_block.html' %} + {% endif %} + {% if resources %}
Resources
{% endif %} - {% endif %}
{% csrf_token %} {% if collection.collection_type == "QUE" %}