Add post-exam display options to CaseCollection model and update template
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
||||
@@ -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)'),
|
||||
),
|
||||
]
|
||||
@@ -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,
|
||||
|
||||
@@ -177,6 +177,17 @@
|
||||
{% endif %}
|
||||
|
||||
{% if question_completed %}
|
||||
|
||||
{% if collection.show_case_link_post %}
|
||||
<div class="mb-3">
|
||||
<a class="btn btn-outline-secondary btn-sm" target="_blank" href="{{ case.get_absolute_url }}">Open case</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if collection.show_findings_post or collection.show_displaysets_post %}
|
||||
{% include 'atlas/case_display_block.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if resources %}
|
||||
<h5>Resources</h4>
|
||||
<ul class="no-list-style">
|
||||
@@ -188,7 +199,6 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
<form method="POST" class="post-form{% if question_completed %} completed{% endif %}">{% csrf_token %}
|
||||
{% if collection.collection_type == "QUE" %}
|
||||
|
||||
Reference in New Issue
Block a user