From 88a5c12bbc0f92902852ec1b14d23b2b698958bb Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Tue, 30 Dec 2025 01:10:40 +0100 Subject: [PATCH] Aggregated counts on front page; "Add items" page now saves pictures --- argocd/deployment.yaml | 2 +- boxes/templates/boxes/add_things.html | 2 +- boxes/templates/boxes/index.html | 7 +++++-- boxes/templatetags/__init__.py | 0 boxes/templatetags/dict_extras.py | 7 +++++++ boxes/views.py | 10 +++++++++- 6 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 boxes/templatetags/__init__.py create mode 100644 boxes/templatetags/dict_extras.py diff --git a/argocd/deployment.yaml b/argocd/deployment.yaml index e67c50d..10308c6 100644 --- a/argocd/deployment.yaml +++ b/argocd/deployment.yaml @@ -27,7 +27,7 @@ spec: mountPath: /data containers: - name: web - image: git.baumann.gr/adebaumann/labhelper:0.036 + image: git.baumann.gr/adebaumann/labhelper:0.037 imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/boxes/templates/boxes/add_things.html b/boxes/templates/boxes/add_things.html index 93244f5..fa8494b 100644 --- a/boxes/templates/boxes/add_things.html +++ b/boxes/templates/boxes/add_things.html @@ -41,7 +41,7 @@ {% endif %} {% if formset.total_form_count %} -
+ {% csrf_token %} diff --git a/boxes/templates/boxes/index.html b/boxes/templates/boxes/index.html index 664a3ce..4f5d1ba 100644 --- a/boxes/templates/boxes/index.html +++ b/boxes/templates/boxes/index.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load mptt_tags %} +{% load dict_extras %} {% block title %}LabHelper - Home{% endblock %} @@ -55,9 +56,11 @@   {% endif %} {{ node.name }} - {% if node.things.exists %} - {{ node.things.count }} + {% with count=type_counts|get_item:node.pk %} + {% if count and count > 0 %} + {{ count }} {% endif %} + {% endwith %} {% if children %}