From 5e578ca2b0746c9e79821e5445fc2f9baeac2080 Mon Sep 17 00:00:00 2001
From: Ross
Date: Mon, 28 Apr 2025 15:45:02 +0100
Subject: [PATCH] improve case management
---
atlas/models.py | 9 ++++
atlas/templates/atlas/case_display_block.html | 17 +++++-
.../atlas/collection_case_view_take.html | 2 +-
atlas/templates/atlas/selfreview_form.html | 1 +
atlas/urls.py | 5 ++
atlas/views.py | 53 +++++++++++++++----
rad/static/css/anatomy.css | 9 +++-
7 files changed, 83 insertions(+), 13 deletions(-)
diff --git a/atlas/models.py b/atlas/models.py
index 1119ef3a..99b9b8bd 100644
--- a/atlas/models.py
+++ b/atlas/models.py
@@ -533,6 +533,15 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
return size
+ def check_user_can_edit(self, user):
+ if user.is_superuser:
+ return True
+
+ if self.author.filter(id=user.id).exists():
+ return True
+
+ return False
+
diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html
index da0c9950..0077c8c8 100755
--- a/atlas/templates/atlas/case_display_block.html
+++ b/atlas/templates/atlas/case_display_block.html
@@ -248,14 +248,29 @@
Diagnostic certainty: {{case.get_diagnostic_certainty_display}}
Collections:
+
+ {% if can_edit %}
Add collection
+ {% endif %}
diff --git a/atlas/templates/atlas/collection_case_view_take.html b/atlas/templates/atlas/collection_case_view_take.html
index 4b2365d4..934ccbed 100644
--- a/atlas/templates/atlas/collection_case_view_take.html
+++ b/atlas/templates/atlas/collection_case_view_take.html
@@ -218,7 +218,7 @@
{% if collection.self_review %}
- Add self review
+ Add self review
{% if self_review %}
Self Feedback
diff --git a/atlas/templates/atlas/selfreview_form.html b/atlas/templates/atlas/selfreview_form.html
index 1e9aaf2c..5d1f48c9 100644
--- a/atlas/templates/atlas/selfreview_form.html
+++ b/atlas/templates/atlas/selfreview_form.html
@@ -8,6 +8,7 @@
Adding self feedback for {{user_exam.exam}}/{{case}}
+ This form allows you to record your own feedback for the question / case. This can take the form of a note or a ranking (1-5) of your findings and interpretation.