Add max_days query parameter
This commit is contained in:
parent
3dc8a7f232
commit
42153f2e27
@ -39,5 +39,5 @@ async def generate_response(request: Request, template_name: str, **additional_c
|
||||
|
||||
|
||||
@router.get("/sidebar/embed.html", response_class=HTMLResponse)
|
||||
async def embed_sidebar(request: Request):
|
||||
return await generate_response(request, "sidebar/embed.html")
|
||||
async def embed_sidebar(request: Request, max_days: int = None):
|
||||
return await generate_response(request, "sidebar/embed.html", max_days=int(max_days))
|
||||
|
@ -1,3 +1,7 @@
|
||||
{% if max_days %}
|
||||
{% set grouped_events = grouped_events[:max_days] %}
|
||||
{% endif %}
|
||||
|
||||
{% for start_date, events in grouped_events %}
|
||||
<div class="calendar-date">
|
||||
<div class="calendar-date-date">
|
||||
|
Loading…
Reference in New Issue
Block a user