diff --git a/fabcal/routers/frontend.py b/fabcal/routers/frontend.py index 92b6ab4..19d9c6a 100644 --- a/fabcal/routers/frontend.py +++ b/fabcal/routers/frontend.py @@ -1,5 +1,3 @@ -import base64 - from datetime import datetime import babel.dates @@ -28,31 +26,16 @@ async def generate_response(request: Request, template_name: str, **additional_c def localized_abbreviated_weekday(dt: datetime): return babel.dates.format_datetime(dt, format="%b", locale="de_DE") - def base64_encode(s: str): - return base64.b64encode(s.encode()).decode() - context = { "request": request, "grouped_events": grouped_events, - "dir": dir, "localized_abbreviated_month": localized_abbreviated_month, "localized_abbreviated_weekday": localized_abbreviated_weekday, - "base64_encode": base64_encode, } context.update(additional_context) - return templates.TemplateResponse( - template_name, - context={ - "request": request, - "grouped_events": grouped_events, - "dir": dir, - "localized_abbreviated_month": localized_abbreviated_month, - "localized_abbreviated_weekday": localized_abbreviated_weekday, - "base64_encode": base64_encode, - }, - ) + return templates.TemplateResponse(template_name, context=context) @router.get("/sidebar/embed.html", response_class=HTMLResponse)