From 5fb3c98941fb612ae3551d6d24d700095d78b73b Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 13 Nov 2025 21:54:25 +0000 Subject: [PATCH] add a normals feature --- atlas/templates/atlas/base.html | 4 + atlas/templates/atlas/case_display_block.html | 4 + atlas/templates/atlas/normals_list.html | 22 +++-- .../atlas/partials/_normal_toggle.html | 28 ++++++ atlas/urls.py | 1 + atlas/views.py | 91 +++++++++++++++++++ 6 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 atlas/templates/atlas/partials/_normal_toggle.html diff --git a/atlas/templates/atlas/base.html b/atlas/templates/atlas/base.html index 7b0e9258..b9e27e33 100755 --- a/atlas/templates/atlas/base.html +++ b/atlas/templates/atlas/base.html @@ -46,6 +46,9 @@
  • Create Case
  • +
  • + Normals +
  • + diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 32392e8f..a7515fc9 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -147,6 +147,10 @@ {# Diagnostic certainty as a badge #} Diagnostic certainty: {{ case.get_diagnostic_certainty_display }} + {# Normal toggle HTMX block #} +
    + {% include "atlas/partials/_normal_toggle.html" %} +
    diff --git a/atlas/templates/atlas/normals_list.html b/atlas/templates/atlas/normals_list.html index eac50d37..246f4592 100644 --- a/atlas/templates/atlas/normals_list.html +++ b/atlas/templates/atlas/normals_list.html @@ -1,5 +1,6 @@ {% extends "atlas/base.html" %} {% load static %} +{% load crispy_forms_tags %} {% block content %}
    @@ -12,7 +13,7 @@
    {{ field.label_tag }} {{ field }} -+
    +
    {% endfor %}
    @@ -22,13 +23,18 @@
    -
    - {% for normal in page_obj.object_list %} - {% include "atlas/partials/_normal_row.html" with normal=normal %} - {% empty %} -
    No normal cases found.
    - {% endfor %} -
    + {% if page_obj.object_list %} +
    + {% for normal in page_obj.object_list %} + + {{ normal.case.title }}{% if normal.age_years %} — {{ normal.age_years }} yrs{% endif %} +
    Added {{ normal.added_date }}
    +
    + {% endfor %} +
    + {% else %} +
    No normal cases found.
    + {% endif %}