left4me/l4d2web/l4d2web/routes
mwiegand 1de61e8e4d
refactor(files): drop the always-True download_supported flag
download_supported was set to True at every call site (3 templates, 2
route render calls) and never to False. The {% set show_download =
download_supported and not entry.broken %} branch in
_overlay_file_node.html was therefore equivalent to {% set
show_download = not entry.broken %}, and {% set has_actions =
(files_overlay or show_download) and not entry.broken %} simplifies
further: when not broken, both clauses make has_actions True
regardless of files_overlay; when broken, both clauses make it False.
So has_actions = not entry.broken.

Collapsed:
  * Removed download_supported = True from overlay_detail.html (×2),
    server_detail.html, and the two render_template calls in
    files_routes.py
  * Removed the show_download intermediate and the inner {% if
    show_download %} guard in _overlay_file_node.html (the surrounding
    {% if has_actions %} already guarantees not entry.broken)
  * has_actions now directly equals not entry.broken

If a future requirement actually wants per-overlay download-disable,
re-introduce a flag at that point with a real callsite that sets it
False (and a test that exercises that path).

pytest: 577 passed, 1 skipped, 3 deselected — unchanged. None of the
existing tests gated on download_supported.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 17:05:17 +02:00
..
__init__.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
auth_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
blueprint_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
console_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
files_routes.py refactor(files): drop the always-True download_supported flag 2026-05-17 17:05:17 +02:00
job_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
log_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
overlay_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
page_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
profile_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
server_routes.py refactor(datetime): introduce UtcDateTime, remove naive-strip workarounds 2026-05-16 11:59:29 +02:00
workshop_routes.py refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00