Rendering code refactor

This commit is contained in:
marc
2025-04-26 19:09:59 +02:00
parent 7a823a98ab
commit d132e6fd60
33 changed files with 638 additions and 188 deletions

View File

@@ -2,7 +2,10 @@
<h5 class="text text-beige"> Previsualització </h5>
<hr class="h-px mt-1 mb-3 bg-beige border-0">
{% if score_render_url %}
<img class="my-2" src="{{ score_render_url }}" />
<div class="flex flex-col items-center
bg-white rounded-lg">
<img class="m-4" src="{{ score_render_url }}" />
</div>
{% else %}
<ol class="text-red-400">
{% for error in errors %}

View File

@@ -47,22 +47,25 @@
{% endif %}
</h5>
<hr class="h-px mt-1 mb-3 bg-beige border-0">
<div class="flex flex-col items-center">
{% if score.img_url is not none %}
<div class="flex justify-center">
<a href="{{ score.pdf_url or score.img_url }}" target="_blank">
<img class="m-2" src="{{ score.img_url }}" />
</a>
{% if score.img_url is not none %}
<div class="flex flex-col items-center
bg-white rounded-lg ">
<div class="flex justify-center">
<a href="{{ score.pdf_url or score.img_url }}" target="_blank">
<img class="py-4 px-2 max-w-full h-auto" src="{{ score.img_url }}" />
</a>
</div>
{% if score.pdf_url is not none %}
<div class="bg-beige border rounded border-beige m-2 p-1">
<a href="{{ score.pdf_url }}" target="_blank">Obre el PDF</a>
</div>
{% if score.pdf_url is not none %}
<div class="text-beige border rounded border-beige m-2 p-1">
<a href="{{ score.pdf_url }}" target="_blank">Obre el PDF</a>
</div>
{% endif %}
{% elif score.pdf_url is not none %}
{% set pdf_url = score.pdf_url %}
{% include "fragments/pdf_viewer.html" %}
{% endif %}
</div>
{% elif score.pdf_url is not none %}
<div class="flex flex-col items-center">
{% set pdf_url = score.pdf_url %}
{% include "fragments/pdf_viewer.html" %}
</div>
{% endif %}
</div>
{% endif %}

View File

@@ -10,11 +10,13 @@
<i class="fa fa-pencil" aria-hidden="true"></i>
</button>
{% include "fragments/tema/visibility.html" %}
<button title="Canvia el títol"
{% if not tema.stats %}
<button title="Esborra el tema"
class="text-beige text-2xl mx-2"
hx-delete="/api/tema/{{ tema.id }}"
hx-swap="outerHTML">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
{% endif %}
{% endif %}
</div>