From f362be43ef4bc4514660c0d6f42ad95f25d97807 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 2 Feb 2026 11:55:43 +0000 Subject: [PATCH] Add inline collection management features; implement search and add functionality for collections in case view --- atlas/filters.py | 23 ++-- atlas/templates/atlas/case_display_block.html | 2 +- atlas/templates/atlas/categories_list.html | 2 +- atlas/templates/atlas/normals_list.html | 2 +- .../atlas/partials/add_collection_inline.html | 26 +++++ .../partials/collection_inline_list.html | 25 ++++ .../atlas/partials/collection_list_item.html | 12 ++ atlas/urls.py | 10 ++ atlas/views.py | 107 ++++++++++++++++++ 9 files changed, 196 insertions(+), 13 deletions(-) create mode 100644 atlas/templates/atlas/partials/add_collection_inline.html create mode 100644 atlas/templates/atlas/partials/collection_inline_list.html create mode 100644 atlas/templates/atlas/partials/collection_list_item.html diff --git a/atlas/filters.py b/atlas/filters.py index 47857abe..2f58c963 100755 --- a/atlas/filters.py +++ b/atlas/filters.py @@ -412,19 +412,22 @@ class NormalCaseFilter(django_filters.FilterSet): helper = FormHelper() helper.form_method = "get" helper.form_tag = False - helper.form_class = "row g-2 align-items-end" + helper.form_class = "row g-2" helper.layout = Layout( Div( Div("examination", css_class="col-md-3"), Div("modality", css_class="col-md-3"), + css_class="row g-2", + ), + Div( Div( - Field("min_value", wrapper_class="mb-0"), - Field("max_value", wrapper_class="mb-0"), - Field("age_unit", wrapper_class="mb-0"), - css_class="col-md-6 d-flex gap-2 align-items-stretch border rounded p-2 bg-body-tertiary", + Field("min_value", wrapper_class="mb-0 d-flex align-items-center"), + Field("max_value", wrapper_class="mb-0 d-flex align-items-center"), + Field("age_unit", wrapper_class="mb-0 d-flex align-items-center"), + css_class="col-12 d-flex gap-2 align-items-center", ), - css_class="row g-2 align-items-end", - ) + css_class="row g-2", + ), ) # Assign helper to the generated form instance and tweak widgets if hasattr(self, 'form') and self.form is not None: @@ -432,12 +435,12 @@ class NormalCaseFilter(django_filters.FilterSet): try: form = self.form if "min_value" in form.fields: - form.fields["min_value"].widget = forms.NumberInput(attrs={"class": "form-control", "min": "0", "step": "1", "style": "width:140px;"}) + form.fields["min_value"].widget = forms.NumberInput(attrs={"class": "form-control w-auto", "min": "0", "step": "1", "style": "min-width:140px;"}) if "max_value" in form.fields: - form.fields["max_value"].widget = forms.NumberInput(attrs={"class": "form-control", "min": "0", "step": "1", "style": "width:140px;"}) + form.fields["max_value"].widget = forms.NumberInput(attrs={"class": "form-control w-auto", "min": "0", "step": "1", "style": "min-width:140px;"}) if "age_unit" in form.fields: form.fields["age_unit"].initial = "days" - form.fields["age_unit"].widget.attrs.update({"class": "form-select", "style": "width:220px;"}) + form.fields["age_unit"].widget.attrs.update({"class": "form-select w-auto", "style": "min-width:220px;"}) form.helper = helper except Exception: # don't crash if form structure differs diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 2f36e3f4..7740fe50 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -453,7 +453,7 @@ Add to collection {% endif %}
-