Enhance QuestionReviewForm layout with Bootstrap styling for status buttons and improve comment field presentation

This commit is contained in:
Ross
2025-10-22 22:05:33 +01:00
parent fa68034f03
commit d19e937bd4
2 changed files with 38 additions and 16 deletions
+4 -3
View File
@@ -31,7 +31,7 @@ from generic.models import (
)
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.forms.widgets import RadioSelect, TextInput, Textarea
from django.forms.widgets import RadioSelect, Textarea
from rapids.models import Rapid
from anatomy.models import AnatomyQuestion
@@ -840,8 +840,9 @@ class QuestionReviewForm(ModelForm):
model = QuestionReview
fields = ["status", "comment"]
widgets = {
"status": RadioSelect(attrs={"class": "form-check-input"}),
"comment": TextInput(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)"}),
# Use Bootstrap "btn-check" inputs so we can style labels as button toggles
"status": RadioSelect(attrs={"class": "btn-check", "autocomplete": "off"}),
"comment": Textarea(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)", "rows": 2}),
}
def __init__(self, *args, **kwargs):