feat: evolution per player (optional)
This commit is contained in:
@@ -36,9 +36,15 @@ def canvas(request: HttpRequest, event_path: str):
|
||||
|
||||
@router.get(f"{PREFIX}/evolution.gif", auth=django_auth_is_staff)
|
||||
@decorate_view(require_game_enabled(path="place"))
|
||||
def evolution_gif(request: HttpRequest, event_path: str):
|
||||
"""Admin-only: replays the full placement history as an animated GIF."""
|
||||
return HttpResponse(build_evolution_gif(request.event), content_type="image/gif")
|
||||
def evolution_gif(request: HttpRequest, event_path: str, players: str = ""):
|
||||
"""Admin-only: replays the full placement history as an animated GIF.
|
||||
|
||||
`players` is an optional comma-separated list of usernames to only
|
||||
replay those players' placements (combined)."""
|
||||
usernames = [name.strip() for name in players.split(",") if name.strip()]
|
||||
return HttpResponse(
|
||||
build_evolution_gif(request.event, usernames), content_type="image/gif"
|
||||
)
|
||||
|
||||
|
||||
@router.get(f"{PREFIX}/placements.csv", auth=django_auth_is_staff)
|
||||
|
||||
Reference in New Issue
Block a user