improve findings
This commit is contained in:
+18
-8
@@ -49,7 +49,7 @@ from generic.models import Examination#, Sign
|
||||
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from django.forms.widgets import RadioSelect, TextInput, Textarea, Select
|
||||
from crispy_forms.layout import Submit, Layout, Fieldset, Field, Div
|
||||
from crispy_forms.layout import Submit, Layout, Fieldset, Field, Div, HTML
|
||||
from crispy_forms.bootstrap import Accordion, AccordionGroup
|
||||
|
||||
from tinymce.widgets import TinyMCE
|
||||
@@ -71,6 +71,12 @@ from typing import Any
|
||||
from helpers.cimar import CimarAPI, NotFoundError
|
||||
from rad.settings import CIMAR_USERNAME, CIMAR_PASSWORD
|
||||
|
||||
class ClearableInput(TextInput):
|
||||
template_name = "crispy_forms/widgets/clearable_input_single_line.html"
|
||||
|
||||
class ClearableTextarea(Textarea):
|
||||
template_name = "crispy_forms/widgets/clearable_input.html"
|
||||
|
||||
class CaseSelect(Select):
|
||||
template_name = "atlas/case_select_widget.html"
|
||||
|
||||
@@ -295,14 +301,16 @@ class SeriesForm(ModelForm):
|
||||
|
||||
class CaseForm(ModelForm):
|
||||
|
||||
# exams = ModelMultipleChoiceField(required=False, queryset=Exam.objects.all(),widget=FilteredSelectMultiple(verbose_name="Exams", is_stacked=False))
|
||||
|
||||
|
||||
class Media:
|
||||
# Django also includes a few javascript files necessary
|
||||
# for the operation of this form element. You need to
|
||||
# include <script src="/admin/jsi18n"></script>
|
||||
# in the template.
|
||||
#history = forms.CharField(
|
||||
# widget=ClearableTextarea(attrs={"maxlength": 1000, "rows": 5, "cols": 80}),
|
||||
# required=False,
|
||||
#)
|
||||
|
||||
css = {
|
||||
"all": ["css/widgets.css"],
|
||||
}
|
||||
@@ -367,7 +375,7 @@ class CaseForm(ModelForm):
|
||||
"open_access",
|
||||
"previous_case",
|
||||
"diagnostic_certainty",
|
||||
"cimar_uuid"
|
||||
"cimar_uuid",
|
||||
),
|
||||
|
||||
)
|
||||
@@ -410,9 +418,11 @@ class CaseForm(ModelForm):
|
||||
# (False, 'No')])
|
||||
# "findings": TinyMCE(attrs={"cols": 80, "rows": 20}),
|
||||
# "mark_scheme": TinyMCE(attrs={"cols": 80, "rows": 30}),
|
||||
"description": Textarea(attrs={"cols": 80, "rows": 5}),
|
||||
"history": Textarea(attrs={"cols": 80, "rows": 5}),
|
||||
"discussion": Textarea(attrs={"cols": 80, "rows": 5}),
|
||||
"title": ClearableInput(attrs={"rows": 1}),
|
||||
"description": ClearableTextarea(attrs={"cols": 80, "rows": 5}),
|
||||
"history": ClearableTextarea(attrs={"maxlength": 2000, "rows": 5}),
|
||||
"discussion": ClearableTextarea(attrs={"maxlength": 2000, "rows": 5}),
|
||||
"report": ClearableTextarea(attrs={"maxlength": 2000, "rows": 5}),
|
||||
"condition": autocomplete.ModelSelect2Multiple(
|
||||
url="atlas:condition-autocomplete"
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user