from fastapi import Request
from folkugat_web.services import sessions as sessions_service
from folkugat_web.templates import templates


def cartell(request: Request, session_id: int, logged_in: bool):
    session = sessions_service.get_session(session_id=session_id)
    return templates.TemplateResponse(
        "fragments/sessio/cartell.html",
        {
            "request": request,
            "logged_in": logged_in,
            "session_id": session_id,
            "session": session,
        }
    )


def cartell_editor(request: Request, session_id: int):
    return templates.TemplateResponse(
        "fragments/sessio/cartell_editor.html",
        {
            "request": request,
            "session_id": session_id,
        }
    )
