Refactor QuestionReviewForm to use RadioSelect for status and update template for improved layout
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ from django.forms import (
|
|||||||
DateField,
|
DateField,
|
||||||
SplitDateTimeField,
|
SplitDateTimeField,
|
||||||
SplitDateTimeWidget,
|
SplitDateTimeWidget,
|
||||||
Select,
|
|
||||||
)
|
)
|
||||||
from django.forms import inlineformset_factory
|
from django.forms import inlineformset_factory
|
||||||
from atlas.models import CaseCollection
|
from atlas.models import CaseCollection
|
||||||
@@ -840,7 +840,7 @@ class QuestionReviewForm(ModelForm):
|
|||||||
model = QuestionReview
|
model = QuestionReview
|
||||||
fields = ["status", "comment"]
|
fields = ["status", "comment"]
|
||||||
widgets = {
|
widgets = {
|
||||||
"status": Select(attrs={"class": "form-select form-select-sm"}),
|
"status": RadioSelect(attrs={"class": "form-check-input"}),
|
||||||
"comment": TextInput(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)"}),
|
"comment": TextInput(attrs={"class": "form-control form-control-sm", "placeholder": "Comment (optional)"}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,18 @@
|
|||||||
class="d-flex gap-2 align-items-start">
|
class="d-flex gap-2 align-items-start">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<div class="form-select-sm">
|
<div class="d-flex gap-2 align-items-center">
|
||||||
{{ form.status }}
|
{% for radio in form.status %}
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
{{ radio.tag }}
|
||||||
|
<label class="form-check-label" for="{{ radio.id_for_label }}">{{ radio.choice_label }}</label>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
{{ form.comment }}
|
{{ form.comment }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-sm btn-primary" type="submit">Save</button>
|
<button class="btn btn-sm btn-primary" type="submit">Save</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user