Refactor: extract edit UI HTML into bincio/edit/templates/edit.html

The 285-line _HTML string literal in edit/server.py is replaced by a
template file loaded at request time. The route handler is unchanged in
behaviour — it still substitutes __SITE_URL__, __SPORT_OPTIONS__, and
__STAT_CHECKBOXES__ before returning the response.

Five new tests cover: 200 response, form presence, site_url injection,
no unresolved placeholders, and template file existence on disk.
This commit is contained in:
Davide Scaini
2026-05-13 23:19:19 +02:00
parent 9dd533825f
commit 2ec4d9157c
4 changed files with 318 additions and 291 deletions
+1 -1
View File
@@ -490,7 +490,7 @@ def test_activity_geojson_missing_geometry(client, tmp_path, authenticated_sessi
| # | Step | Status |
|---|---|---|
| 1 | Extract shared image utilities → `bincio/shared/images.py` | Done |
| 2 | Extract HTML template → `bincio/edit/templates/edit.html` | Not started |
| 2 | Extract HTML template → `bincio/edit/templates/edit.html` | Done |
| 3 | Split `serve/server.py` into `deps.py` + `routers/*` | Not started |
| 4 | Narrow broad `except Exception:` catches | Not started |