TrafoKing/templates/participants/results.html
2025-05-13 01:32:51 +02:00

71 lines
2.4 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load static%}
{% block title %}Resultados · Trafoking{% endblock %}
{% block content %}
<h2 class="text-3xl font-bold mb-8 text-[color:var(--brand-yellow)]">
Ranking
</h2>
{% if rankings %}
<table id="ranking-table"
class="w-full max-w-2xl mx-auto border-separate border-spacing-y-2">
<thead>
<tr>
<th class="text-left px-4">#</th>
<th class="text-left px-4">Grupo</th>
<th class="text-right px-4">Total</th>
</tr>
</thead>
<tbody>
{% for entry in rankings %}
{% with forloop.counter as rank %}
<tr class="transform transition duration-500 opacity-0 scale-95"
data-rank="{{ rank }}">
<td class="px-4 py-2">
<span class="font-bold
{% if rank == 1 %}text-2xl text-[#FFD700]
{% elif rank == 2 %}text-xl text-[#C0C0C0]
{% elif rank == 3 %}text-xl text-[#CD7F32]
{% else %}text-base{% endif %}">
{{ rank }}
</span>
</td>
<td class="px-4 py-2 font-semibold
{% if rank == 1 %}text-2xl text-[#FFD700]
{% elif rank == 2 %}text-xl text-[#C0C0C0]
{% elif rank == 3 %}text-xl text-[#CD7F32]{% endif %}">
{{ entry.participant.group_name }}
</td>
<td class="px-4 py-2 text-right">
<span class="font-mono">
{{ entry.total|floatformat:2 }}
</span>
</td>
</tr>
<tr class="bg-white bg-opacity-10 transform transition duration-500 opacity-0 scale-95"
data-rank="{{ rank }}">
<td colspan="3" class="px-4 py-2 text-sm">
Base: {{ entry.base|floatformat:2 }}
|Similitud: {{ entry.sim_total|floatformat:2 }}
|Objetivo: {{ entry.obj_bonus|floatformat:2 }}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-center text-red-500 text-lg">
No hay datos para mostrar el ranking.
</p>
{% endif %}
<a href="{% url 'participant_new' %}"
class="btn btn-primary mt-10 inline-block">
Añadir más grupos
</a>
<script src="{% static 'js/animations.js' %}"></script>
{% endblock %}