Escollir partitura del tema en un set
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user