Canvi de nom a les URLs playlist -> llista
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
from folkugat_web.api.router import get_router
|
||||
|
||||
from . import auth, index, playlist, sessio, sessions, tema, temes
|
||||
from . import auth, index, llista, sessio, sessions, tema, temes
|
||||
|
||||
router = get_router()
|
||||
|
||||
router.include_router(auth.router)
|
||||
router.include_router(index.router)
|
||||
router.include_router(playlist.router)
|
||||
router.include_router(llista.router)
|
||||
router.include_router(sessio.router)
|
||||
router.include_router(sessions.router)
|
||||
router.include_router(tema.router)
|
||||
|
||||
@@ -11,7 +11,7 @@ from folkugat_web.templates import templates
|
||||
router = get_router()
|
||||
|
||||
|
||||
@router.get("/playlist/{playlist_id}")
|
||||
@router.get("/llista/{playlist_id}")
|
||||
def page(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -27,13 +27,13 @@ def page(
|
||||
"page_title": "Folkugat - Setlist",
|
||||
"page_description": playlist.name or "Llista de temes",
|
||||
"page_card": None,
|
||||
"content": f"/api/content/playlist/{playlist_id}",
|
||||
"content": f"/api/content/llista/{playlist_id}",
|
||||
"logged_in": logged_in,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/content/playlist/{playlist_id}")
|
||||
@router.get("/api/content/llista/{playlist_id}")
|
||||
def contingut(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -42,7 +42,7 @@ def contingut(
|
||||
return playlist.pagina(request, playlist_id, logged_in)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/name")
|
||||
@router.get("/api/llista/{playlist_id}/name")
|
||||
def get_name(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -51,7 +51,7 @@ def get_name(
|
||||
return playlist.name(request=request, playlist_id=playlist_id, logged_in=logged_in)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/editor/name")
|
||||
@router.get("/api/llista/{playlist_id}/editor/name")
|
||||
def name_editor(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -60,7 +60,7 @@ def name_editor(
|
||||
return playlist.name_editor(request=request, playlist_id=playlist_id, logged_in=logged_in)
|
||||
|
||||
|
||||
@router.put("/api/playlist/{playlist_id}/name")
|
||||
@router.put("/api/llista/{playlist_id}/name")
|
||||
def set_name(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -71,7 +71,7 @@ def set_name(
|
||||
return playlist.name(request=request, playlist_id=playlist_id, logged_in=logged_in)
|
||||
|
||||
|
||||
@router.post("/api/playlist/{playlist_id}/set")
|
||||
@router.post("/api/llista/{playlist_id}/set")
|
||||
def add_set(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -84,7 +84,7 @@ def add_set(
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/set/{set_id}")
|
||||
@router.get("/api/llista/{playlist_id}/set/{set_id}")
|
||||
def get_set(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -99,7 +99,7 @@ def get_set(
|
||||
)
|
||||
|
||||
|
||||
@router.delete("/api/playlist/{playlist_id}/set/{set_id}")
|
||||
@router.delete("/api/llista/{playlist_id}/set/{set_id}")
|
||||
def delete_set(
|
||||
_: auth.RequireLogin,
|
||||
playlist_id: int,
|
||||
@@ -111,7 +111,7 @@ def delete_set(
|
||||
)
|
||||
|
||||
|
||||
@router.post("/api/playlist/{playlist_id}/set/{set_id}")
|
||||
@router.post("/api/llista/{playlist_id}/set/{set_id}")
|
||||
def add_tema(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -126,7 +126,7 @@ def add_tema(
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
@router.get("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
def get_tema(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -143,7 +143,7 @@ def get_tema(
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}/editor")
|
||||
@router.get("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}/editor")
|
||||
def get_tema_editor(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -160,7 +160,7 @@ def get_tema_editor(
|
||||
)
|
||||
|
||||
|
||||
@router.delete("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
@router.delete("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
def delete_tema(
|
||||
_: auth.RequireLogin,
|
||||
playlist_id: int,
|
||||
@@ -174,7 +174,7 @@ def delete_tema(
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}/busca")
|
||||
@router.get("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}/busca")
|
||||
def busca_tema(
|
||||
request: Request,
|
||||
_: auth.RequireLogin,
|
||||
@@ -192,7 +192,7 @@ def busca_tema(
|
||||
)
|
||||
|
||||
|
||||
@router.put("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
@router.put("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
def set_tema(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -211,7 +211,7 @@ def set_tema(
|
||||
)
|
||||
|
||||
|
||||
@router.put("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}/unknown")
|
||||
@router.put("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}/unknown")
|
||||
def set_tema_unknown(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -229,7 +229,7 @@ def set_tema_unknown(
|
||||
)
|
||||
|
||||
|
||||
@router.post("/api/playlist/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
@router.post("/api/llista/{playlist_id}/set/{set_id}/tema/{entry_id}")
|
||||
def set_tema_new(
|
||||
request: Request,
|
||||
logged_in: auth.RequireLogin,
|
||||
@@ -17,7 +17,7 @@ def set_description(set_: playlists.Set) -> str:
|
||||
]))
|
||||
|
||||
|
||||
@router.get("/playlist/{playlist_id}/set/{set_id}")
|
||||
@router.get("/llista/{playlist_id}/set/{set_id}")
|
||||
def page(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -34,13 +34,13 @@ def page(
|
||||
"request": request,
|
||||
"page_title": "Folkugat - Set",
|
||||
"page_description": set_description(set_=set_),
|
||||
"content": f"/api/content/playlist/{playlist_id}/set/{set_id}",
|
||||
"content": f"/api/content/llista/{playlist_id}/set/{set_id}",
|
||||
"logged_in": logged_in,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@router.get("/api/content/playlist/{playlist_id}/set/{set_id}")
|
||||
@router.get("/api/content/llista/{playlist_id}/set/{set_id}")
|
||||
async def contingut(
|
||||
request: Request,
|
||||
logged_in: auth.LoggedIn,
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="flex flex-row flex-wrap justify-center"
|
||||
id="playlist-name">
|
||||
id="llista-name">
|
||||
<form>
|
||||
<input name="name"
|
||||
placeholder="Nom de la playlist"
|
||||
@@ -10,15 +10,15 @@
|
||||
/>
|
||||
<button title="Desa"
|
||||
class="text-beige text-3xl mx-1"
|
||||
hx-put="/api/playlist/{{ playlist.id }}/name"
|
||||
hx-target="#playlist-name"
|
||||
hx-put="/api/llista/{{ playlist.id }}/name"
|
||||
hx-target="#llista-name"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-check" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button title="Descarta"
|
||||
class="text-beige text-3xl mx-1"
|
||||
hx-get="/api/playlist/{{ playlist.id }}/name"
|
||||
hx-target="#playlist-name"
|
||||
hx-get="/api/llista/{{ playlist.id }}/name"
|
||||
hx-target="#llista-name"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="flex flex-row flex-wrap justify-center"
|
||||
id="playlist-name">
|
||||
id="llista-name">
|
||||
<h3 class="text-3xl text-center p-4">
|
||||
{% if playlist.name %}
|
||||
{{ playlist.name }}
|
||||
@@ -10,8 +10,8 @@
|
||||
{% if logged_in %}
|
||||
<button title="Canvia el nom"
|
||||
class="text-beige text-2xl mx-2"
|
||||
hx-get="/api/playlist/{{ playlist.id }}/editor/name"
|
||||
hx-target="#playlist-name"
|
||||
hx-get="/api/llista/{{ playlist.id }}/editor/name"
|
||||
hx-target="#llista-name"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% include "fragments/menu.html" %}
|
||||
<div class="flex justify-center">
|
||||
<div class="m-12 grow max-w-4xl">
|
||||
<div id="playlist-name">
|
||||
<div id="llista-name">
|
||||
{% include "fragments/playlist/name.html" %}
|
||||
</div>
|
||||
<div class="text-left">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ul id="playlist-{{ playlist_id }}" class="">
|
||||
<ul id="llista-{{ playlist_id }}" class="">
|
||||
{% for set_entry in playlist.sets %}
|
||||
{% set set_id = set_entry.id %}
|
||||
{% include "fragments/playlist/set_entry.html" %}
|
||||
@@ -7,8 +7,8 @@
|
||||
{% if logged_in %}
|
||||
<div class="flex flex-col items-center">
|
||||
<button class="text-beige mt-2"
|
||||
hx-post="/api/playlist/{{ playlist_id }}/set"
|
||||
hx-target="#playlist-{{ playlist_id }}"
|
||||
hx-post="/api/llista/{{ playlist_id }}/set"
|
||||
hx-target="#llista-{{ playlist_id }}"
|
||||
hx-swap="beforeend transition:true">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
Afegeix set
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
m-4 rounded-lg bg-white
|
||||
px-2 py-1 my-1"
|
||||
id="set-entry-{{ set_id }}"
|
||||
hx-get="/api/playlist/{{ playlist_id }}/set/{{ set_id }}"
|
||||
hx-target="#set-entry-{{ set_id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-trigger="reload-set-{{ set_id }}">
|
||||
hx-get="/api/llista/{{ playlist_id }}/set/{{ set_id }}"
|
||||
hx-target="#set-entry-{{ set_id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-trigger="reload-set-{{ set_id }}">
|
||||
{% if set_entry.temes | length > 1 or not set_entry.temes[0].tema %}
|
||||
{% set set_url = "/playlist/%d/set/%d" | format(playlist_id, set_id) %}
|
||||
{% set set_url = "/llista/%d/set/%d" | format(playlist_id, set_id) %}
|
||||
{% else %}
|
||||
{% set set_url = "/tema/%d" | format(set_entry.temes[0].tema_id) %}
|
||||
{% endif %}
|
||||
@@ -24,27 +24,27 @@
|
||||
py-2 mx-2
|
||||
w-full max-w-[655px]">
|
||||
{% if logged_in %}
|
||||
<button class="text-beige w-full"
|
||||
hx-delete="/api/playlist/{{ playlist_id }}/set/{{ set_id }}"
|
||||
hx-target="#set-entry-{{ set_id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
Esborra el set
|
||||
</button>
|
||||
{% endif %}
|
||||
<ol id="set-entry-{{ set_id }}-list"
|
||||
class="flex flex-col items-start w-full">
|
||||
{% for tema_entry in set_entry.temes %}
|
||||
{% if new_entry %}
|
||||
{% include "fragments/playlist/tema_editor.html" %}
|
||||
{% else %}
|
||||
{% include "fragments/playlist/tema_entry.html" %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% if logged_in %}
|
||||
<button class="text-beige mt-2 w-full"
|
||||
hx-post="/api/playlist/{{ playlist_id }}/set/{{ set_id }}"
|
||||
<button class="text-beige w-full"
|
||||
hx-delete="/api/llista/{{ playlist_id }}/set/{{ set_id }}"
|
||||
hx-target="#set-entry-{{ set_id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
Esborra el set
|
||||
</button>
|
||||
{% endif %}
|
||||
<ol id="set-entry-{{ set_id }}-list"
|
||||
class="flex flex-col items-start w-full">
|
||||
{% for tema_entry in set_entry.temes %}
|
||||
{% if new_entry %}
|
||||
{% include "fragments/playlist/tema_editor.html" %}
|
||||
{% else %}
|
||||
{% include "fragments/playlist/tema_entry.html" %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% if logged_in %}
|
||||
<button class="text-beige mt-2 w-full"
|
||||
hx-post="/api/llista/{{ playlist_id }}/set/{{ set_id }}"
|
||||
hx-target="#set-entry-{{ set_id }}-list"
|
||||
hx-swap="beforeend transition:true">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
class="border border-beige focus:outline-none
|
||||
rounded text-center text-black
|
||||
p-1 m-1"
|
||||
hx-get="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}/busca"
|
||||
hx-trigger="revealed, keyup delay:500ms changed"
|
||||
hx-target="#tune-entry-{{ tema_entry.id }}-search-results"
|
||||
hx-swap="outerHTML"/>
|
||||
hx-get="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}/busca"
|
||||
hx-trigger="revealed, keyup delay:500ms changed"
|
||||
hx-target="#tune-entry-{{ tema_entry.id }}-search-results"
|
||||
hx-swap="outerHTML"/>
|
||||
<button title="Descarta els canvis"
|
||||
class="text-beige mx-1"
|
||||
hx-get="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}"
|
||||
hx-get="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}"
|
||||
hx-target="#tune-entry-{{ tema_entry.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
<div class="flex-none flex flex-row shrink-0">
|
||||
<button title="Edita el tema"
|
||||
class="text-beige mx-1"
|
||||
hx-get="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}/editor"
|
||||
hx-get="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}/editor"
|
||||
hx-target="#tune-entry-{{ tema_entry.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button title="Esborra el tema"
|
||||
class="text-beige mx-1"
|
||||
hx-delete="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}"
|
||||
hx-delete="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}"
|
||||
hx-target="#tune-entry-{{ tema_entry.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<li>
|
||||
<button class="bg-beige text-brown rounded
|
||||
m-1 px-2"
|
||||
hx-put="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}"
|
||||
hx-put="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}"
|
||||
hx-vals='{"tema_id": "{{ tema.id }}"}'
|
||||
hx-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
@@ -15,7 +15,7 @@
|
||||
<li>
|
||||
<button class="border border-beige text-beige rounded
|
||||
m-1 px-2"
|
||||
hx-put="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}/unknown"
|
||||
hx-put="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}/unknown"
|
||||
hx-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-question" aria-hidden="true"></i>
|
||||
@@ -25,7 +25,7 @@
|
||||
<li>
|
||||
<button class="border border-beige text-beige rounded
|
||||
m-1 px-2"
|
||||
hx-post="/api/playlist/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}"
|
||||
hx-post="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ entry_id }}"
|
||||
hx-vals='{"title": "{{ query }}"}'
|
||||
hx-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
{% if logged_in or (session.slowjam and session.slowjam.sets) %}
|
||||
<div class="text-left">
|
||||
<h4 class="py-4 text-xl text-beige mt-2">
|
||||
<a href="/playlist/{{ session.slowjam.id }}" class="text-beige">
|
||||
<a href="/llista/{{ session.slowjam.id }}" class="text-beige">
|
||||
Slow Jam
|
||||
</a>
|
||||
</h4>
|
||||
@@ -52,7 +52,7 @@
|
||||
{% if logged_in or (session.setlist and session.setlist.sets) %}
|
||||
<div class="text-left">
|
||||
<h4 class="py-4 text-xl text-beige mt-2">
|
||||
<a href="/playlist/{{ session.setlist.id }}" class="text-beige">
|
||||
<a href="/llista/{{ session.setlist.id }}" class="text-beige">
|
||||
Temes tocats
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
Reference in New Issue
Block a user