Tota la set entry ara linka o bé al set o al tema

This commit is contained in:
marc
2025-10-26 13:00:30 +01:00
parent 98c009ba53
commit badb73098a
3 changed files with 51 additions and 54 deletions

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,14 @@
hx-target="#set-entry-{{ set_id }}" hx-target="#set-entry-{{ set_id }}"
hx-swap="outerHTML" hx-swap="outerHTML"
hx-trigger="reload-set-{{ set_id }}"> hx-trigger="reload-set-{{ set_id }}">
{% if set_entry.temes | length > 1 or not set_entry.temes[0] %}
{% set set_url = "/sessio/%d/set/%d" | format(session_id, set_id) %}
{% else %}
{% set set_url = "/tema/%d" | format(set_entry.temes[0].tema_id) %}
{% endif %}
<a href="{{ set_url }}"
class="flex flex-row grow items-center cursor-pointer"
title="Mostra els temes">
<div class="flex-1"></div> <div class="flex-1"></div>
<div class="flex flex-col <div class="flex flex-col
items-start items-start
@@ -40,16 +48,8 @@
</button> </button>
{% endif %} {% endif %}
</div> </div>
<div class="flex-1"> <div class="flex-1 text-beige">
<a title="Mostra els temes"
class="text-beige"
{% if set_entry.temes | length > 1 or not set_entry.temes[0] %}
href="/sessio/{{ session_id }}/set/{{ set_id }}"
{% else %}
href="/tema/{{ set_entry.temes[0].tema_id }}"
{% endif %}
>
<i class="fa fa-chevron-right" aria-hidden="true"></i> <i class="fa fa-chevron-right" aria-hidden="true"></i>
</a>
</div> </div>
</a>
</li> </li>

View File

@@ -1,12 +1,11 @@
<li id="tune-entry-{{ tema_entry.id }}" <li id="tune-entry-{{ tema_entry.id }}"
class="flex flex-col w-full"> class="flex flex-col w-full">
<div class="flex flex-row my-1 w-full"> <div class="flex flex-row my-1 w-full">
<div class="flex-1 min-w-0 text-black font-bold"> <div class="flex-1 min-w-0
text-black font-bold
break-words block">
{% if tema_entry.tema %} {% if tema_entry.tema %}
<a href="/tema/{{ tema_entry.tema_id }}"
class="break-words block">
{{ tema_entry.tema.title }} {{ tema_entry.tema.title }}
</a>
{% else %} {% else %}
<i class="fa fa-question" aria-hidden="true"></i> <i class="fa fa-question" aria-hidden="true"></i>
<i>(Desconegut)</i> <i>(Desconegut)</i>
@@ -33,10 +32,8 @@
</div> </div>
<div class="my-1 w-full"> <div class="my-1 w-full">
{% if tema_entry.tema and tema_entry.tema.main_score() and tema_entry.tema.main_score().preview_url %} {% if tema_entry.tema and tema_entry.tema.main_score() and tema_entry.tema.main_score().preview_url %}
<a href="/tema/{{ tema_entry.tema.id }}"> <img class="pb-2"
<img class="px-4 pb-2"
src="{{ tema_entry.tema.main_score().preview_url }}" /> src="{{ tema_entry.tema.main_score().preview_url }}" />
</a>
{% endif %} {% endif %}
</div> </div>
</li> </li>