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,50 +6,50 @@
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 }}">
<div class="flex-1"></div> {% if set_entry.temes | length > 1 or not set_entry.temes[0] %}
<div class="flex flex-col {% set set_url = "/sessio/%d/set/%d" | format(session_id, set_id) %}
items-start {% else %}
py-2 mx-2 {% set set_url = "/tema/%d" | format(set_entry.temes[0].tema_id) %}
w-full max-w-[655px]"> {% endif %}
{% if logged_in %} <a href="{{ set_url }}"
<button class="text-beige w-full" class="flex flex-row grow items-center cursor-pointer"
hx-delete="/api/sessio/{{ session_id }}/set/{{ set_id }}" title="Mostra els temes">
hx-target="#set-entry-{{ set_id }}" <div class="flex-1"></div>
hx-swap="outerHTML"> <div class="flex flex-col
<i class="fa fa-times" aria-hidden="true"></i> items-start
Esborra el set py-2 mx-2
</button> w-full max-w-[655px]">
{% endif %} {% if logged_in %}
<ol id="set-entry-{{ set_id }}-list" <button class="text-beige w-full"
class="flex flex-col items-start w-full"> hx-delete="/api/sessio/{{ session_id }}/set/{{ set_id }}"
{% for tema_entry in set_entry.temes %} hx-target="#set-entry-{{ set_id }}"
{% if new_entry %} hx-swap="outerHTML">
{% include "fragments/sessio/tema_editor.html" %} <i class="fa fa-times" aria-hidden="true"></i>
{% else %} Esborra el set
{% include "fragments/sessio/tema_entry.html" %} </button>
{% endif %} {% endif %}
{% endfor %} <ol id="set-entry-{{ set_id }}-list"
</ol> class="flex flex-col items-start w-full">
{% if logged_in %} {% for tema_entry in set_entry.temes %}
<button class="text-beige mt-2 w-full" {% if new_entry %}
hx-post="/api/sessio/{{ session_id }}/set/{{ set_id }}" {% include "fragments/sessio/tema_editor.html" %}
hx-target="#set-entry-{{ set_id }}-list" {% else %}
hx-swap="beforeend transition:true"> {% include "fragments/sessio/tema_entry.html" %}
<i class="fa fa-plus" aria-hidden="true"></i> {% endif %}
Afegeix un tema {% endfor %}
</button> </ol>
{% endif %} {% if logged_in %}
</div> <button class="text-beige mt-2 w-full"
<div class="flex-1"> hx-post="/api/sessio/{{ session_id }}/set/{{ set_id }}"
<a title="Mostra els temes" hx-target="#set-entry-{{ set_id }}-list"
class="text-beige" hx-swap="beforeend transition:true">
{% if set_entry.temes | length > 1 or not set_entry.temes[0] %} <i class="fa fa-plus" aria-hidden="true"></i>
href="/sessio/{{ session_id }}/set/{{ set_id }}" Afegeix un tema
{% else %} </button>
href="/tema/{{ set_entry.temes[0].tema_id }}" {% endif %}
{% endif %} </div>
> <div class="flex-1 text-beige">
<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>