diff --git a/backend/routers/projects.py b/backend/routers/projects.py
index 576d867..87fecfe 100644
--- a/backend/routers/projects.py
+++ b/backend/routers/projects.py
@@ -2851,17 +2851,20 @@ async def upload_all_project_data(
Determine the grouping key for a file path.
Files inside Auto_####/Auto_Leq/ or Auto_####/Auto_Lp_01/ are collapsed
up to their Auto_#### parent so they all land in the same session.
+ Only folder components are examined (not the filename, which is parts[-1]).
"""
- # Find the deepest Auto_#### component (case-insensitive)
+ # Only look at folder components — exclude the filename (last part)
+ folder_parts = parts[:-1]
auto_idx = None
- for i, p in enumerate(parts):
- if p.lower().startswith("auto_") and not p.lower().startswith("auto_leq") and not p.lower().startswith("auto_lp"):
+ for i, p in enumerate(folder_parts):
+ p_lower = p.lower()
+ if p_lower.startswith("auto_") and not p_lower.startswith("auto_leq") and not p_lower.startswith("auto_lp"):
auto_idx = i
if auto_idx is not None:
# Group key = everything up to and including Auto_####
- return "/".join(parts[:auto_idx + 1])
+ return "/".join(folder_parts[:auto_idx + 1])
# Fallback: use the immediate parent folder
- return "/".join(parts[:-1]) if len(parts) > 1 else ""
+ return "/".join(folder_parts) if folder_parts else ""
# --- Group files by session key ---
groups: dict[str, list[tuple[str, bytes]]] = defaultdict(list)
diff --git a/backend/templates_config.py b/backend/templates_config.py
index c0e4212..453b284 100644
--- a/backend/templates_config.py
+++ b/backend/templates_config.py
@@ -5,6 +5,7 @@ All routers should import `templates` from this module to get consistent
filter and global function registration.
"""
+import json as _json
from fastapi.templating import Jinja2Templates
# Import timezone utilities
@@ -32,8 +33,38 @@ def jinja_timezone_abbr():
# Create templates instance
templates = Jinja2Templates(directory="templates")
+def jinja_local_date(dt, fmt="%m-%d-%y"):
+ """Jinja filter: format a UTC datetime as a local date string (e.g. 02-19-26)."""
+ return format_local_datetime(dt, fmt)
+
+
+def jinja_fromjson(s):
+ """Jinja filter: parse a JSON string into a dict (returns {} on failure)."""
+ if not s:
+ return {}
+ try:
+ return _json.loads(s)
+ except Exception:
+ return {}
+
+
+def jinja_same_date(dt1, dt2) -> bool:
+ """Jinja global: True if two datetimes fall on the same local date."""
+ if not dt1 or not dt2:
+ return False
+ try:
+ d1 = format_local_datetime(dt1, "%Y-%m-%d")
+ d2 = format_local_datetime(dt2, "%Y-%m-%d")
+ return d1 == d2
+ except Exception:
+ return False
+
+
# Register Jinja filters and globals
templates.env.filters["local_datetime"] = jinja_local_datetime
templates.env.filters["local_time"] = jinja_local_time
+templates.env.filters["local_date"] = jinja_local_date
+templates.env.filters["fromjson"] = jinja_fromjson
templates.env.globals["timezone_abbr"] = jinja_timezone_abbr
templates.env.globals["get_user_timezone"] = get_user_timezone
+templates.env.globals["same_date"] = jinja_same_date
diff --git a/templates/partials/projects/unified_files.html b/templates/partials/projects/unified_files.html
index 2d56854..118c217 100644
--- a/templates/partials/projects/unified_files.html
+++ b/templates/partials/projects/unified_files.html
@@ -23,12 +23,26 @@
Bulk Import — Select Folder
@@ -1575,7 +1575,7 @@ document.getElementById('schedule-modal')?.addEventListener('click', function(e) } }); -// ── Upload All ─────────────────────────────────────────────────────────────── +// ── Upload Days ─────────────────────────────────────────────────────────────── function toggleUploadAll() { const panel = document.getElementById('upload-all-panel');