{% for jornada in cranking.competicion.jornadas %}
{% set keyEntity = clasificadoRankingId ~ '-' ~ jornada.id %}
{% set competicion = cranking.competicion %}
{% set puntuacion = "" %}
{% set tooltip = 0 %}
{% set data = 0 %}
{% if puntos[clasificadoRankingId][keyEntity]['puntos'] is defined and (not puntos[clasificadoRankingId][keyEntity]['puntos'] is null) %}
{% set puntuacion = puntos[clasificadoRankingId][keyEntity]['puntos'] %}
{% set data = 1 %}
{% if puntos[clasificadoRankingId][keyEntity]['penalidad'] is defined and (not puntos[clasificadoRankingId][keyEntity]['penalidad'] is null) %}
{% set tooltip = 1 %}
{% if isMedal %}
{% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
{% else %}
{% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
{% endif %}
{% endif %}
{% if puntos[clasificadoRankingId][keyEntity]['bonus'] is defined and (not puntos[clasificadoRankingId][keyEntity]['bonus'] is null) %}
{% set tooltip = 1 %}
{% if isMedal %}
{% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['bonus'] %}
{% else %}
{% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['bonus'] %}
{% endif %}
{% endif %}
{% else %}
{% set puntuacion = 0 %}
{% if puntos[clasificadoRankingId][keyEntity]['penalidad'] is defined and (puntos[clasificadoRankingId][keyEntity]['penalidad'] is not null) %}
{% set data = 1 %}
{% if isMedal %}
{% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
{% else %}
{% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
{% endif %}
{% set tooltip = 1 %}
{% endif %}
{% if puntos[clasificadoRankingId][keyEntity]['bonus'] is defined and (puntos[clasificadoRankingId][keyEntity]['bonus'] is not null) %}
{% set data = 1 %}
{% if isMedal %}
{% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['bonus'] %}
{% else %}
{% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['bonus'] %}
{% endif %}
{% set tooltip = 1 %}
{% endif %}
{% endif %}
{% if puntuacion < 0 %}
{% set puntuacion = 0 %}
{% endif %}
<div class="tableCell tableCell-competicion
{% if puntos[clasificadoRankingId] is defined and puntos[clasificadoRankingId][keyEntity] is defined and puntos[clasificadoRankingId][keyEntity]['mejor_prueba'] is defined and puntos[clasificadoRankingId][keyEntity]['mejor_prueba'] %}puntuable{% endif %}"
{% if tooltip > 0 %}
data-content="
Puntos: {{ puntos[clasificadoRankingId][keyEntity]['puntos']|default(0) }}
{% if puntos[clasificadoRankingId][keyEntity]['penalidad'] ?? 0 != 0 %} | Penalidad: {{ puntos[clasificadoRankingId][keyEntity]['penalidad'] }}{% endif %}
{% if puntos[clasificadoRankingId][keyEntity]['bonus'] ?? 0 != 0 %} | Bonus: {{ puntos[clasificadoRankingId][keyEntity]['bonus'] }}{% endif %}"
data-inverted=""
{% endif %}
>
<a class="cell-points" {% if puntos[clasificadoRankingId][keyEntity]['inscrito'] is defined %}href="javascript:cardOpener({{ puntos[clasificadoRankingId][keyEntity]['inscrito'] }}, {{ jornada.orden }});"{% endif %}>
<span>{% if data %}{{ puntuacion + 0 }}{% else %}-{% endif %}</span>
<span>{% if puntos[clasificadoRankingId][keyEntity]['penalidad'] is defined and (not puntos[clasificadoRankingId][keyEntity]['penalidad'] is null) %}<svg class="icon-bonus-penalty" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M16 4c6.6 0 12 5.4 12 12s-5.4 12-12 12S4 22.6 4 16S9.4 4 16 4m0-2C8.3 2 2 8.3 2 16s6.3 14 14 14s14-6.3 14-14S23.7 2 16 2"></path><path fill="currentColor" d="M8 15h16v2H8z"></path></svg>{% endif %}</span>
<span>{% if puntos[clasificadoRankingId][keyEntity]['bonus'] is defined and (not puntos[clasificadoRankingId][keyEntity]['bonus'] is null) %}<svg class="icon-bonus-penalty" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M16 4c6.6 0 12 5.4 12 12s-5.4 12-12 12S4 22.6 4 16S9.4 4 16 4m0-2C8.3 2 2 8.3 2 16s6.3 14 14 14s14-6.3 14-14S23.7 2 16 2"></path><path fill="currentColor" d="M24 15h-7V8h-2v7H8v2h7v7h2v-7h7z"></path></svg>{% endif %}</span>
</a>
</div>
{% endfor %}