From 68f45c85611bb1dc9dc3fed316ea98204e75f849 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 22 Oct 2025 22:01:49 +0100 Subject: [PATCH] Refactor QuestionReviewForm to use RadioSelect for status and update template for improved layout --- generic/forms.py | 8 ++++---- .../generic/partials/question_review_form.html | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/generic/forms.py b/generic/forms.py index 81056838..6b7fc63b 100755 --- a/generic/forms.py +++ b/generic/forms.py @@ -11,7 +11,7 @@ from django.forms import ( DateField, SplitDateTimeField, SplitDateTimeWidget, - Select, + ) from django.forms import inlineformset_factory from atlas.models import CaseCollection @@ -840,9 +840,9 @@ class QuestionReviewForm(ModelForm): model = QuestionReview fields = ["status", "comment"] widgets = { - "status": Select(attrs={"class": "form-select form-select-sm"}), - "comment": TextInput(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)"}), - } + "status": RadioSelect(attrs={"class": "form-check-input"}), + "comment": TextInput(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)"}), + } def __init__(self, *args, **kwargs): # Accept an optional `user` for future validation/use diff --git a/generic/templates/generic/partials/question_review_form.html b/generic/templates/generic/partials/question_review_form.html index 879c95e1..e9be1aab 100644 --- a/generic/templates/generic/partials/question_review_form.html +++ b/generic/templates/generic/partials/question_review_form.html @@ -5,11 +5,18 @@ class="d-flex gap-2 align-items-start"> {% csrf_token %} -
- {{ form.status }} +
+ {% for radio in form.status %} +
+ {{ radio.tag }} + +
+ {% endfor %}
+
{{ form.comment }} +