diff --git a/atlas/migrations/0038_auto_20220408_2355.py b/atlas/migrations/0038_auto_20220408_2355.py new file mode 100644 index 00000000..4ce699e5 --- /dev/null +++ b/atlas/migrations/0038_auto_20220408_2355.py @@ -0,0 +1,43 @@ +# Generated by Django 3.2.4 on 2022-04-08 22:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0037_cidreportanswer_feedback'), + ] + + operations = [ + migrations.RenameField( + model_name='casecollection', + old_name='show_description', + new_name='show_description_pre', + ), + migrations.RenameField( + model_name='casecollection', + old_name='show_discussion', + new_name='show_discussion_pre', + ), + migrations.RenameField( + model_name='casecollection', + old_name='show_history', + new_name='show_history_pre', + ), + migrations.RenameField( + model_name='casecollection', + old_name='show_report', + new_name='show_report_pre', + ), + migrations.RenameField( + model_name='casecollection', + old_name='show_title', + new_name='show_title_pre', + ), + migrations.AlterField( + model_name='casecollection', + name='publish_results', + field=models.BooleanField(default=False, help_text='If a collection should published'), + ), + ] diff --git a/atlas/migrations/0039_auto_20220408_2357.py b/atlas/migrations/0039_auto_20220408_2357.py new file mode 100644 index 00000000..2940c1ee --- /dev/null +++ b/atlas/migrations/0039_auto_20220408_2357.py @@ -0,0 +1,63 @@ +# Generated by Django 3.2.4 on 2022-04-08 22:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0038_auto_20220408_2355'), + ] + + operations = [ + migrations.AddField( + model_name='casecollection', + name='show_description_post', + field=models.BooleanField(default=False, help_text='Show the description of the cases (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_discussion_post', + field=models.BooleanField(default=False, help_text='Show the case discussion (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_history_post', + field=models.BooleanField(default=False, help_text='Show the history of the cases (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_report_post', + field=models.BooleanField(default=False, help_text='Show the case report (post exam)'), + ), + migrations.AddField( + model_name='casecollection', + name='show_title_post', + field=models.BooleanField(default=False, help_text='Show the title of the cases (post exam)'), + ), + migrations.AlterField( + model_name='casecollection', + name='show_description_pre', + field=models.BooleanField(default=False, help_text='Show the description of the cases (pre exam)'), + ), + migrations.AlterField( + model_name='casecollection', + name='show_discussion_pre', + field=models.BooleanField(default=False, help_text='Show the case discussion (pre exam)'), + ), + migrations.AlterField( + model_name='casecollection', + name='show_history_pre', + field=models.BooleanField(default=False, help_text='Show the history of the cases (pre exam)'), + ), + migrations.AlterField( + model_name='casecollection', + name='show_report_pre', + field=models.BooleanField(default=False, help_text='Show the case report (pre exam)'), + ), + migrations.AlterField( + model_name='casecollection', + name='show_title_pre', + field=models.BooleanField(default=False, help_text='Show the title of the cases (pre exam)'), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 40d4b766..8b9c8f6a 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -11,7 +11,6 @@ import tagulous import tagulous.models - import pydicom import dicognito.anonymizer @@ -591,7 +590,6 @@ class Series(models.Model): pass - class CaseCollection(models.Model): name = models.CharField(max_length=255, unique=True) @@ -605,19 +603,37 @@ class CaseCollection(models.Model): help_text="If a collection should be available", default=True ) - show_title = models.BooleanField( - default=False, help_text="Show the title of the cases" + show_title_pre = models.BooleanField( + default=False, help_text="Show the title of the cases (pre exam)" ) - show_history = models.BooleanField( - default=False, help_text="Show the history of the cases" + show_history_pre = models.BooleanField( + default=False, help_text="Show the history of the cases (pre exam)" ) - show_description = models.BooleanField( - default=False, help_text="Show the description of the cases" + show_description_pre = models.BooleanField( + default=False, help_text="Show the description of the cases (pre exam)" ) - show_discussion = models.BooleanField( - default=False, help_text="Show the case discussion" + show_discussion_pre = models.BooleanField( + default=False, help_text="Show the case discussion (pre exam)" + ) + show_report_pre = models.BooleanField( + default=False, help_text="Show the case report (pre exam)" + ) + + show_title_post = models.BooleanField( + default=False, help_text="Show the title of the cases (post exam)" + ) + show_history_post = models.BooleanField( + default=False, help_text="Show the history of the cases (post exam)" + ) + show_description_post = models.BooleanField( + default=False, help_text="Show the description of the cases (post exam)" + ) + show_discussion_post = models.BooleanField( + default=False, help_text="Show the case discussion (post exam)" + ) + show_report_post = models.BooleanField( + default=False, help_text="Show the case report (post exam)" ) - show_report = models.BooleanField(default=False, help_text="Show the case report") author = models.ManyToManyField( settings.AUTH_USER_MODEL, @@ -709,6 +725,7 @@ class CaseCollection(models.Model): content_type=content_type, object_id=self.pk, cid_user=cid_user ) + class CaseDetail(models.Model): case = models.ForeignKey(Case, on_delete=models.CASCADE) collection = models.ForeignKey(CaseCollection, on_delete=models.CASCADE) @@ -720,7 +737,7 @@ class CaseDetail(models.Model): class CidReportAnswer(models.Model): - question = models.ForeignKey(CaseDetail, on_delete=models.CASCADE ) + question = models.ForeignKey(CaseDetail, on_delete=models.CASCADE) answer = models.TextField(blank=True) diff --git a/atlas/templates/atlas/collection_case_view_take.html b/atlas/templates/atlas/collection_case_view_take.html index bf054d2a..afaae560 100644 --- a/atlas/templates/atlas/collection_case_view_take.html +++ b/atlas/templates/atlas/collection_case_view_take.html @@ -3,18 +3,18 @@ {% block content %}