Also group assignments in the same way as notes
All checks were successful
Deploy to birb co. production / deploy (push) Successful in 6s

This commit is contained in:
2026-02-25 16:50:15 -08:00
parent 49c7132863
commit 2cb09552c2
2 changed files with 23 additions and 7 deletions

View File

@@ -75,13 +75,29 @@ def scan_shared() -> list[Section]:
assignments_dir = SHARED_DIR / "assignments"
if assignments_dir.exists():
zip_name = "assignments.zip"
create_zip(assignments_dir, ZIPS_DIR / zip_name)
sections.append(Section(
title="Assignments",
zip_url=f"zips/{zip_name}",
files=list_files(assignments_dir),
))
subdirs = sorted(
d for d in assignments_dir.iterdir()
if d.is_dir() and should_include(d)
)
if subdirs:
subsections = []
for subdir in subdirs:
zip_name = f"assignments-{subdir.name}.zip"
create_zip(subdir, ZIPS_DIR / zip_name)
subsections.append(SubSection(
name=subdir.name,
zip_url=f"zips/{zip_name}",
files=list_files(subdir),
))
sections.append(Section(title="Assignments", subsections=subsections))
else:
zip_name = "assignments.zip"
create_zip(assignments_dir, ZIPS_DIR / zip_name)
sections.append(Section(
title="Assignments",
zip_url=f"zips/{zip_name}",
files=list_files(assignments_dir),
))
notes_dir = SHARED_DIR / "notes-and-examples"
if notes_dir.exists():