templates/frontend/Ranking/components/competition_cells.html.twig line 1

Open in your IDE?
  1. {% set entityRelatedId = '' %}
  2.     {% if cranking.competicion is not null %}
  3.         {% set entityRelatedId = cranking.competicion.id %}
  4.     {% elseif cranking.externalCompetition is not null %}
  5.         {% set entityRelatedId = cranking.externalCompetition.id %}
  6.     {% endif %}
  7. {% set keyEntity = clasificadoRankingId ~ '-' ~ entityRelatedId %}
  8. {% set puntuacion = "" %}
  9. {% set data = 0 %}
  10. {% set tooltip = 0 %}
  11. {% if puntos[clasificadoRankingId][keyEntity]['puntos'] is defined and (not puntos[clasificadoRankingId][keyEntity]['puntos'] is null) %}
  12.     {% set puntuacion = puntos[clasificadoRankingId][keyEntity]['puntos'] %}
  13.     {% set data = 1 %}
  14.     {% if puntos[clasificadoRankingId][keyEntity]['penalidad'] is defined and (not puntos[clasificadoRankingId][keyEntity]['penalidad'] is null) %}
  15.         {% set tooltip = 1 %}
  16.         {% if isMedal %}
  17.             {% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
  18.         {% else %}
  19.             {% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['penalidad'] %}
  20.         {% endif %}
  21.     {% endif %}
  22.     {% if puntos[clasificadoRankingId][keyEntity]['bonus'] is defined and (not puntos[clasificadoRankingId][keyEntity]['bonus'] is null) %}
  23.         {% set tooltip = 1 %}
  24.         {% if isMedal %}
  25.             {% set puntuacion = puntuacion - puntos[clasificadoRankingId][keyEntity]['bonus'] %}
  26.         {% else %}
  27.             {% set puntuacion = puntuacion + puntos[clasificadoRankingId][keyEntity]['bonus'] %}
  28.         {% endif %}
  29.     {% endif %}
  30. {% endif %}
  31. {% if puntuacion < 0 %}
  32.     {% set puntuacion = 0 %}
  33. {% endif %}
  34. <div class="tableCell tableCell-competicion
  35. {% 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 %}"
  36.     {% if tooltip > 0 %}
  37.         data-content="{% if puntos[clasificadoRankingId][keyEntity]['puntos'] ?? false %}Puntos: {{ puntos[clasificadoRankingId][keyEntity]['puntos']|default(null) }}{% endif %}
  38.         {% if puntos[clasificadoRankingId][keyEntity]['penalidad'] ?? 0 != 0 %} | Penalidad: {{ puntos[clasificadoRankingId][keyEntity]['penalidad'] }}{% endif %}
  39.         {% if puntos[clasificadoRankingId][keyEntity]['bonus'] ?? 0 != 0 %} | Bonus: {{ puntos[clasificadoRankingId][keyEntity]['bonus'] }}{% endif %}"
  40.         data-inverted=""
  41.     {% endif %}
  42. >
  43.     <a class="cell-points"
  44.        {% if puntos[clasificadoRankingId] is defined and puntos[clasificadoRankingId][keyEntity] is defined and puntos[clasificadoRankingId][keyEntity]['inscrito'] is defined and cranking.competicion is not null %}href="javascript:cardOpener({{ puntos[clasificadoRankingId][keyEntity]['inscrito'] }}, 0);"{% endif %}>
  45.         <span>{% if data %}{{ puntuacion + 0 }}{% else %}-{% endif %}</span>
  46.         <span class="icon-penalty">{% if data and puntos[clasificadoRankingId][keyEntity]['penalidad'] is defined and (not puntos[clasificadoRankingId][keyEntity]['penalidad'] is null) %}
  47.             <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>
  48.         <span class="icon-bonus">{% if data and puntos[clasificadoRankingId][keyEntity]['bonus'] is defined and (not puntos[clasificadoRankingId][keyEntity]['bonus'] is null) %}
  49.             <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>
  50.     </a>
  51. </div>