Escollir partitura del tema en un set

This commit is contained in:
marc
2026-02-16 23:03:01 +01:00
parent 443c1b1391
commit 89f72dbb33
13 changed files with 1385 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@@ -30,10 +30,34 @@
</div>
{% endif %}
</div>
{% if logged_in and tema_entry.tema %}
{% set available_scores = tema_entry.tema.scores | selectattr('hidden', 'equalto', false) | list %}
{% if available_scores | length > 1 %}
<div class="flex flex-row items-center my-1 w-full text-sm">
<span class="text-gray-600 mr-2">Partitura:</span>
<select class="border border-beige bg-beige rounded p-1 text-sm"
hx-put="/api/llista/{{ playlist_id }}/set/{{ set_id }}/tema/{{ tema_entry.id }}/score"
hx-target="#tune-entry-{{ tema_entry.id }}"
hx-swap="outerHTML"
name="score_id">
<option value="-1" {% if not tema_entry.score_id %}selected{% endif %}>
(Per defecte)
</option>
{% for score in available_scores %}
<option value="{{ score.id }}"
{% if tema_entry.score_id == score.id %}selected{% endif %}>
{{ score.title or 'Partitura ' ~ loop.index }}
</option>
{% endfor %}
</select>
</div>
{% endif %}
{% endif %}
<div class="my-1 w-full">
{% if tema_entry.tema and tema_entry.tema.main_score() and tema_entry.tema.main_score().preview_url %}
{% set effective_score = tema_entry.get_effective_score() %}
{% if effective_score and effective_score.preview_url %}
<img class="pb-2"
src="{{ tema_entry.tema.main_score().preview_url }}" />
src="{{ effective_score.preview_url }}" />
{% endif %}
</div>
</li>