From bb6b4c625cbcdcfa92a3665aaaa1696403e2e7de Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 4 Jul 2026 23:43:18 +0100 Subject: [PATCH] max improvement --- atlas/forms.py | 11 +- atlas/templates/atlas/base_popup.html | 21 +++ atlas/templates/atlas/collection_viva.html | 2 +- .../atlas/collection_viva_local.html | 2 +- .../partials/case_create_resource_inline.html | 21 +++ .../atlas/partials/resource_search_panel.html | 8 + .../templates/atlas/question_link_header.html | 2 +- atlas/templates/atlas/resource_form.html | 2 +- atlas/templates/atlas/resource_list.html | 9 + atlas/urls.py | 8 +- atlas/views.py | 156 ++++++++++++++---- scripts/local-down.sh | 2 +- scripts/local-up.sh | 9 + 13 files changed, 217 insertions(+), 36 deletions(-) create mode 100644 atlas/templates/atlas/base_popup.html create mode 100644 atlas/templates/atlas/partials/case_create_resource_inline.html diff --git a/atlas/forms.py b/atlas/forms.py index a77e009f..469df42b 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -1495,12 +1495,21 @@ class CaseSeriesForm(forms.ModelForm): def __init__(self, *args, queryset, user=None, is_atlas_editor=False, **kwargs): super().__init__(*args, **kwargs) self.fields["series"].queryset = queryset - self.fields["series"].label_from_instance = lambda obj: str(obj.pk) + self.fields["series"].label_from_instance = lambda obj: f"Series {obj.pk}: {obj.description or ''} ({obj.modality or ''})" class Meta: model = SeriesDetail # through model for Case.series fields = ["series", "sort_order", "feedback"] + widgets = { + "series": autocomplete.ModelSelect2( + url="atlas:series-autocomplete", + attrs={ + "data-placeholder": "Search by Series ID or description...", + "data-minimum-input-length": 0, + } + ) + } class CaseUpdateSeriesForm(forms.ModelForm): diff --git a/atlas/templates/atlas/base_popup.html b/atlas/templates/atlas/base_popup.html new file mode 100644 index 00000000..1be8057c --- /dev/null +++ b/atlas/templates/atlas/base_popup.html @@ -0,0 +1,21 @@ + +{% load static %} +{% load django_htmx %} +{% load crispy_forms_tags %} + + + Create Resource + + + + + + {% block js %} + {% endblock %} + + + + {% block content %} + {% endblock %} + + diff --git a/atlas/templates/atlas/collection_viva.html b/atlas/templates/atlas/collection_viva.html index 616ff57d..7ce1af28 100644 --- a/atlas/templates/atlas/collection_viva.html +++ b/atlas/templates/atlas/collection_viva.html @@ -35,7 +35,7 @@ View Case
diff --git a/atlas/templates/atlas/collection_viva_local.html b/atlas/templates/atlas/collection_viva_local.html index 2bf0e1fe..276e45bb 100644 --- a/atlas/templates/atlas/collection_viva_local.html +++ b/atlas/templates/atlas/collection_viva_local.html @@ -48,7 +48,7 @@ View Case
diff --git a/atlas/templates/atlas/partials/case_create_resource_inline.html b/atlas/templates/atlas/partials/case_create_resource_inline.html new file mode 100644 index 00000000..253fa3f5 --- /dev/null +++ b/atlas/templates/atlas/partials/case_create_resource_inline.html @@ -0,0 +1,21 @@ +{% load crispy_forms_tags %} +
+ {% csrf_token %} +
Create New Resource
+ {{ form|crispy }} +
+ + +
+
+ + +
+
diff --git a/atlas/templates/atlas/partials/resource_search_panel.html b/atlas/templates/atlas/partials/resource_search_panel.html index ec01a5a1..c88a4703 100644 --- a/atlas/templates/atlas/partials/resource_search_panel.html +++ b/atlas/templates/atlas/partials/resource_search_panel.html @@ -35,6 +35,14 @@ +
+ +
diff --git a/atlas/templates/atlas/question_link_header.html b/atlas/templates/atlas/question_link_header.html index 38601583..b17ce188 100644 --- a/atlas/templates/atlas/question_link_header.html +++ b/atlas/templates/atlas/question_link_header.html @@ -2,7 +2,7 @@