Pàgines llista de reproducció
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from fastapi import Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from folkugat_web.model.pagines import Pages
|
||||
from folkugat_web.model.playlists import PlaylistType
|
||||
from folkugat_web.services import playlists as playlists_service
|
||||
from folkugat_web.services import sessions as sessions_service
|
||||
from folkugat_web.services.temes import query as query_service
|
||||
@@ -170,3 +172,54 @@ def set_tema(request: Request, logged_in: bool, playlist_id: int, set_id: int, e
|
||||
"tema_entry": tema_entry,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def pagina(request: Request, playlist_id: int, logged_in: bool):
|
||||
playlist = playlists_service.get_playlist(playlist_id=playlist_id)
|
||||
if not playlist:
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(status_code=404, detail="Could not find playlist")
|
||||
playlist = playlists_service.add_temes_to_playlist(playlist)
|
||||
return templates.TemplateResponse(
|
||||
"fragments/playlist/pagina.html",
|
||||
{
|
||||
"request": request,
|
||||
"logged_in": logged_in,
|
||||
"playlist_id": playlist_id,
|
||||
"playlist": playlist,
|
||||
"Pages": Pages,
|
||||
"PlaylistType": PlaylistType
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def name(request: Request, playlist_id: int, logged_in: bool):
|
||||
playlist = playlists_service.get_playlist(playlist_id=playlist_id)
|
||||
if not playlist:
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(status_code=404, detail="Could not find playlist")
|
||||
return templates.TemplateResponse(
|
||||
"fragments/playlist/name.html",
|
||||
{
|
||||
"request": request,
|
||||
"logged_in": logged_in,
|
||||
"playlist_id": playlist_id,
|
||||
"playlist": playlist,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def name_editor(request: Request, playlist_id: int, logged_in: bool):
|
||||
playlist = playlists_service.get_playlist(playlist_id=playlist_id)
|
||||
if not playlist:
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(status_code=404, detail="Could not find playlist")
|
||||
return templates.TemplateResponse(
|
||||
"fragments/playlist/editor/name.html",
|
||||
{
|
||||
"request": request,
|
||||
"logged_in": logged_in,
|
||||
"playlist_id": playlist_id,
|
||||
"playlist": playlist,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user