From c01000f06e44c1eeaff2689fd49ef4b90dd02432 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 15 Dec 2025 10:42:58 +0000 Subject: [PATCH] Refactor resource search functionality: replace inline form with a dedicated search panel and improve result handling --- atlas/templates/atlas/case_display_block.html | 30 +---- atlas/templates/atlas/index.html | 122 +++++++++--------- .../atlas/partials/resource_search_panel.html | 41 ++++++ .../resource_search_widget_results.html | 68 +++++----- 4 files changed, 138 insertions(+), 123 deletions(-) create mode 100644 atlas/templates/atlas/partials/resource_search_panel.html diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 08826e78..177ee772 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -205,35 +205,7 @@
Resources
-
- -
- -
-
- -
-
- -
-
-
- - -
-
-
-
+ {% include 'atlas/partials/resource_search_panel.html' %}
diff --git a/atlas/templates/atlas/index.html b/atlas/templates/atlas/index.html index 6ca62ada..c616633b 100644 --- a/atlas/templates/atlas/index.html +++ b/atlas/templates/atlas/index.html @@ -1,77 +1,77 @@ {% extends 'atlas/base.html' %} {% block content %} -
-
-
-

Atlas

-
-
- -
-
-
-
-
Collections
-

Quick access to collections you can view or take.

- Collections to view / take -
-
- -
-
-
My cases / collections
-

View my cases or my collections.

-

- - Uploads awaiting import - -

-
+
+
+
+

Atlas

-
-
-
-
Quick links
- +
+
+
+
+
Collections
+

Quick access to collections you can view or take.

+ Collections to view / take +
+
+ +
+
+
My cases / collections
+

View my cases or my collections.

+

+ + Uploads awaiting import + +

+
-
-
-
Search cases
-
-
- - + +
+ +
+
+
Search cases
+
+
+ + +
+
+ +
+ {% include 'atlas/partials/_case_search_results.html' with cases=None %}
- -
- {% include 'atlas/partials/_case_search_results.html' with cases=None %} -
-
{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/partials/resource_search_panel.html b/atlas/templates/atlas/partials/resource_search_panel.html new file mode 100644 index 00000000..dbe54cb0 --- /dev/null +++ b/atlas/templates/atlas/partials/resource_search_panel.html @@ -0,0 +1,41 @@ +
+
+ +
+ +
+
+ Searching... +
+
+ +
+
+ +
+
+
+ + +
+
+
+ +
+
diff --git a/atlas/templates/atlas/partials/resource_search_widget_results.html b/atlas/templates/atlas/partials/resource_search_widget_results.html index 9c19cd24..787ba4de 100644 --- a/atlas/templates/atlas/partials/resource_search_widget_results.html +++ b/atlas/templates/atlas/partials/resource_search_widget_results.html @@ -1,37 +1,39 @@ {% if results %} -
    - {% for item in results %} -
  • -
    - {{ item.name|escape }} -
    {{ item.get_display|safe }}
    -
    -
    - - -
    -
  • - {% endfor %} -
-
- {{ results|length }} results +
+
    + {% for item in results %} +
  • +
    + {{ item.name|escape }} +
    {{ item.get_display|safe }}
    +
    +
    + + +
    +
  • + {% endfor %} +
+
+ {{ results|length }} results +
{% else %} -
No resources found
+
No resources found
{% endif %}