Desacoblar playlists de sessions i afegir slow jams
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<ul id="playlist-{{ playlist_id }}" class="">
|
||||
{% for set_entry in playlist.sets %}
|
||||
{% set set_id = set_entry.id %}
|
||||
{% include "fragments/playlist/set_entry.html" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% 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-swap="beforeend transition:true">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
Afegeix set
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,2 @@
|
||||
{% include "fragments/menu.html" %}
|
||||
{% include "fragments/playlist/set/set_page.html" %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{% if session is not none %}
|
||||
<div class="text-beige m-3">
|
||||
{% set dn = date_names(session.date) %}
|
||||
<a href="/sessio/{{ session.id }}">
|
||||
<i class="fa fa-chevron-left px-2" aria-hidden="true"></i>
|
||||
<i>
|
||||
Tocat el {{ dn.day_name }} {{ dn.day }} {{ dn.month_name }} de {{ dn.year }}
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if set.score %}
|
||||
{% for tema_in_set in set.temes %}
|
||||
{% if tema_in_set.tema is not none %}
|
||||
{% set tema = tema_in_set.tema %}
|
||||
{% include "fragments/playlist/set/tema_title.html" %}
|
||||
{% else %}
|
||||
<h3 class="text-center text-3xl p-4"> <i>Desconegut</i> </h3>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="mx-12">
|
||||
<hr class="h-px mt-1 mb-3 bg-beige border-0">
|
||||
{% include "fragments/playlist/set/set_score.html"%}
|
||||
</div>
|
||||
{% else %}
|
||||
{% for tema_in_set in set.temes %}
|
||||
{% if loop.index != 1 %}
|
||||
<div class="mx-12">
|
||||
<hr class="h-px mt-1 mb-3 bg-beige border-0">
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if tema_in_set.tema is not none %}
|
||||
{% set tema = tema_in_set.tema %}
|
||||
{% include "fragments/playlist/set/tema.html"%}
|
||||
{% else %}
|
||||
<h3 class="text-center text-3xl p-4">
|
||||
<i>Desconegut</i>
|
||||
</h3>
|
||||
<div class="text-center">
|
||||
<i>No sabem quin tema és aquest</i>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="m-8"> </div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,13 @@
|
||||
<div class="flex flex-col items-center
|
||||
bg-white rounded-lg ">
|
||||
<div class="flex justify-center">
|
||||
<a href="{{ set.score.pdf_url or score.img_url }}" target="_blank">
|
||||
<img class="py-4 px-2 max-w-full h-auto" src="{{ set.score.img_url }}" />
|
||||
</a>
|
||||
</div>
|
||||
{% if set.score.pdf_url is not none %}
|
||||
<div class="bg-beige border rounded border-beige m-2 p-1">
|
||||
<a href="{{ set.score.pdf_url }}" target="_blank">Obre el PDF</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
{% include "fragments/playlist/set/tema_title.html" %}
|
||||
<div class="mx-12 text-left">
|
||||
|
||||
{% if tema.main_score() is not none %}
|
||||
{% set score = tema.main_score() %}
|
||||
{% include "fragments/tema/score.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if tema.lyrics %}
|
||||
{% set lyric = tema.lyrics[0] %}
|
||||
<div>
|
||||
<h4 class="mt-4 text-xl text-beige">Lletra</h4>
|
||||
<hr class="h-px mt-1 mb-3 bg-beige border-0">
|
||||
<div class="text-center">
|
||||
{{ lyric.content.replace('\n', '<br>') | safe }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
<h3 class="text-center text-3xl p-4">
|
||||
{{ tema.title }}
|
||||
<a class="text-beige"
|
||||
º href="/tema/{{ tema.id }}">
|
||||
<i class="fa fa-chevron-right px-2" aria-hidden="true"></i>
|
||||
</a>
|
||||
</h3>
|
||||
@@ -0,0 +1,61 @@
|
||||
<li class="flex flex-row grow items-center
|
||||
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 }}">
|
||||
{% 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) %}
|
||||
{% else %}
|
||||
{% set set_url = "/tema/%d" | format(set_entry.temes[0].tema_id) %}
|
||||
{% endif %}
|
||||
{% if logged_in %}
|
||||
<div class="flex flex-row grow items-center">
|
||||
{% else %}
|
||||
<a href="{{ set_url }}"
|
||||
class="flex flex-row grow items-center cursor-pointer"
|
||||
title="Mostra els temes">
|
||||
{% endif %}
|
||||
<div class="flex-1"></div>
|
||||
<div class="flex flex-col
|
||||
items-start
|
||||
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 }}"
|
||||
hx-target="#set-entry-{{ set_id }}-list"
|
||||
hx-swap="beforeend transition:true">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
Afegeix un tema
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="flex-1 text-beige">
|
||||
{% if logged_in %}<a href="{{ set_url }}" class="text-beige">{% endif %}
|
||||
<i class="fa fa-chevron-right" aria-hidden="true"></i>
|
||||
{% if logged_in %}</a>{% endif %}
|
||||
</div>
|
||||
{% if logged_in %}</div>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
@@ -0,0 +1,30 @@
|
||||
<li id="tune-entry-{{ tema_entry.id }}"
|
||||
class="flex flex-col items-center my-1 w-full">
|
||||
<div class="flex flex-row">
|
||||
<input
|
||||
name="query"
|
||||
{% if tema_entry.tema %}
|
||||
value="{{ tema_entry.tema.title }}"
|
||||
{% else %}
|
||||
value=""
|
||||
{% endif %}
|
||||
placeholder="Busca un tema..."
|
||||
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"/>
|
||||
<button title="Descarta els canvis"
|
||||
class="text-beige mx-1"
|
||||
hx-get="/api/playlist/{{ 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>
|
||||
</button>
|
||||
</div>
|
||||
<ul id="tune-entry-{{ tema_entry.id }}-search-results"
|
||||
class="flex flex-wrap">
|
||||
</ul>
|
||||
</li>
|
||||
@@ -0,0 +1,39 @@
|
||||
<li id="tune-entry-{{ tema_entry.id }}"
|
||||
class="flex flex-col w-full">
|
||||
<div class="flex flex-row my-1 w-full">
|
||||
<div class="flex-1 min-w-0
|
||||
text-black font-bold
|
||||
break-words block">
|
||||
{% if tema_entry.tema %}
|
||||
{{ tema_entry.tema.title }}
|
||||
{% else %}
|
||||
<i class="fa fa-question" aria-hidden="true"></i>
|
||||
<i>(Desconegut)</i>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if logged_in %}
|
||||
<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-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-target="#tune-entry-{{ tema_entry.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="my-1 w-full">
|
||||
{% if tema_entry.tema and tema_entry.tema.main_score() and tema_entry.tema.main_score().preview_url %}
|
||||
<img class="pb-2"
|
||||
src="{{ tema_entry.tema.main_score().preview_url }}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
@@ -0,0 +1,36 @@
|
||||
<ul id="tune-entry-{{ entry_id }}-search-results"
|
||||
class="flex flex-wrap items-center justify-center">
|
||||
{% for tema in results %}
|
||||
<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-vals='{"tema_id": "{{ tema.id }}"}'
|
||||
hx-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
{{ tema.title }}
|
||||
</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<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-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-question" aria-hidden="true"></i>
|
||||
<i>(Desconegut)</i>
|
||||
</button>
|
||||
</li>
|
||||
<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-vals='{"title": "{{ query }}"}'
|
||||
hx-target="#tune-entry-{{ entry_id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
<i>{{ query }}</i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user