templates/frontend/Club/components/item-competition.html.twig line 1

Open in your IDE?
  1. {% set competitionDate = competition.fecha %}
  2. {% set competitionName = competition.nombre %}
  3. {% set competitionStatus = competition.estado|default(null) %}
  4. {% set competitionOrganiser = competition.organizer is defined ? competition.organizer : competition.organizador.id %}
  5. {% set competitionPlayerByTeam = competition.jugadores|default(null) %}
  6. {% set competitionId = competition.id %}
  7. {% set competitionMode = competition.mode is defined ? competition.mode|default(null) : competition.modo.id|default(null) %}
  8. <div class="item">
  9.     <div class="ui grid">
  10.         <div class="three wide column ">
  11.             {% set colorCalendar = "blue" %}
  12.             {% set claseTransition  = "" %}
  13.             {% set claseLong = "longshadow" %}
  14.             {% set claseOverflow = "hide-overflow" %}
  15.             {% if isFuture %}
  16.                 {% if competitionDate == 'now'|date('Y-m-d') %}
  17.                     {% set colorCalendar = "red" %}
  18.                     {% set claseLong = "longshadow-red" %}
  19.                     {% set claseOverflow = "hide-overflow-today" %}
  20.                 {% endif %}
  21.             {% else %}
  22.                 {% if rounds[competitionId] is defined %}
  23.                     {% for round in rounds[competitionId] %}
  24.                         {% if round.fecha == 'now'|date('Y-m-d') %}
  25.                             {% set colorCalendar = "red" %}
  26.                             {% set claseLong = "longshadow-red" %}
  27.                             {% set claseTransition  = "transition hidden" %}
  28.                             {% set claseOverflow = "hide-overflow-today" %}
  29.                         {% endif %}
  30.                     {% endfor %}
  31.                 {% endif %}
  32.             {% endif %}
  33.             <div class="ui tiny inverted statistics {{ claseTransition }}">
  34.                 <div class="ui compact segments noMarginTop noBorder noShadow">
  35.                     <div class="ui tertiary segment noPaddingBottom noPaddingLeft noPaddingRight noPaddingTop center aligned">
  36.                         {{ competitionDate|format_date(pattern='E', locale=locale) }}
  37.                     </div>
  38.                     <div class="ui basic segment noPaddingBottom noPaddingLeft noPaddingRight noPaddingTop  ">
  39.                         <div class="ui {{ colorCalendar }} mini label {{ claseOverflow }}">
  40.                             <div class="statistic">
  41.                                 <div class="value">
  42.                                     <span class="day {{ claseLong }}">{{ competitionDate|format_date(pattern='dd', locale=locale) }} </span>
  43.                                 </div>
  44.                                 <div class="label">
  45.                                     <span class="month {{ claseLong }}">{{ competitionDate|format_date(pattern='MMM', locale=locale) }}</span>
  46.                                 </div>
  47.                             </div>
  48.                         </div>
  49.                     </div>
  50.                 </div>
  51.             </div>
  52.         </div>
  53.         <div class="thirteen wide column">
  54.             {% set popup = "" %}
  55.             {% if competitionName|length > 35 %}
  56.                 {% set popup = competitionName %}
  57.             {% endif %}
  58.             <a class="ui header truncate" id="nombreTorDis{{ competitionId }}"
  59.                href="{{ not competition.grouping ? path('_tournament', {'id': competitionId, 'publi': publi }) : path('frontend_grouping_show', {'id': competitionId}) }}"
  60.                data-content="{{ popup }}" data-variation="inverted">
  61.                 {% if "cancelada" != competitionStatus %}
  62.                     {{ competitionName }}
  63.                 {% else %}
  64.                     <em><s><span class="ui grey text">{{ competitionName }}</span></s></em>
  65.                 {% endif %}
  66.             </a>
  67.             <div class="row padding10top {% if not isFuture %}name-container{% endif %}">
  68.                 {% if entity.id != "AM00" and competitionOrganiser == "AM00" %}
  69.                     <div class="ui tiny basic green label">RFGA</div>
  70.                 {% elseif entity.id != "CM00" and competitionOrganiser == "CM00" %}
  71.                     <div class="ui tiny basic green label">FGM</div>
  72.                 {% elseif (("M00" in entity.id) and ("M00" in competitionOrganiser)) %}
  73.                     <div class="ui tiny basic green label">
  74.                         {{ competition.club }}
  75.                     </div>
  76.                 {% endif %}
  77.                 {% if competition.wagr is defined and competition.wagr %}
  78.                     <div class="ui tiny basic teal label">WAGR</div>
  79.                 {% endif %}
  80.                 {% if competition.calculationName is defined %}
  81.                     <div class="ui tiny label">{{ competition.calculationName }}</div>
  82.                 {% endif %}
  83.                 {% if not isFuture and bestResults[competitionId] is defined and bestResults[competitionId] and competition.livescoring == 'publico' %}
  84.                     {% set bestResultValue = bestResults[competitionId].result %}
  85.                     {% set claseContraPar = 'basic blue' %}
  86.                     {% if bestResults[competitionId].formula != 'P' %}
  87.                         {% if bestResultValue < 0 %}
  88.                             {% set claseContraPar = 'red' %}
  89.                         {% elseif bestResultValue > 0 %}
  90.                             {% set claseContraPar = 'blue' %}
  91.                             {% if competitionPlayerByTeam == 1 %}
  92.                                 {% set bestResultValue = '+'~bestResults[competitionId].result %}
  93.                             {% endif %}
  94.                         {% else %}
  95.                             {% set bestResultValue = 'PAR' %}
  96.                         {% endif %}
  97.                     {% endif %}
  98.                     {% if bestResults[competitionId].result is defined and bestResults[competitionId].result is not null %}
  99.                         <span class="ui {{ claseContraPar }} circular label">
  100.                             {{ bestResultValue }}
  101.                         </span>
  102.                     {% endif %}
  103.                     <span class="cinema">
  104.                         {{ bestResults[competitionId].player }}
  105.                     </span>
  106.                 {% endif %}
  107.                 {% if isFuture and competitionMode == 3 %}
  108.                     {% if competitionStatus == 'abierta' %}
  109.                         {% if competition.plazas != 0 %}
  110.                             {% if competitionPlayerByTeam == 1 %}
  111.                                 <a href="{{ path('competicion_inscritos_new', {'id': competitionId }) }}"
  112.                                    role="button" class="ui primary button right floated">
  113.                                     {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  114.                                 </a>
  115.                             {% elseif competitionPlayerByTeam == 2 %}
  116.                                 <a href="{{ path('competicion_inscritos_pareja_new', {'id': competitionId }) }}"
  117.                                    class="ui primary button right floated" role="button">
  118.                                     {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  119.                                 </a>
  120.                             {% else %}
  121.                                 <a href="{{ path('competicion_inscritos_equipo_new', {'id': competitionId }) }}"
  122.                                    class="ui primary button right floated" role="button">
  123.                                     {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  124.                                 </a>
  125.                             {% endif %}
  126.                         {% else %}
  127.                             <button class="ui grey basic button boton-modal right floated"
  128.                                     data-texto="No tenemos plazas disponibles">
  129.                                 {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  130.                             </button>
  131.                         {% endif %}
  132.                     {% else %}
  133.                         {% set mensaje_boton = "" %}
  134.                         {% if competitionStatus == 'congelada' %}
  135.                             {% set mensaje_boton = 'messages.inscripcion.congelada'|trans({}, 'FrontendBundle') %}
  136.                         {% elseif competitionStatus == 'cancelada' %}
  137.                             {% set mensaje_boton = 'messages.inscripcion.cancelada'|trans({}, 'FrontendBundle') %}
  138.                         {% else %}
  139.                             {% set mensaje_boton = 'messages.inscripcion.finalizada'|trans({}, 'FrontendBundle') %}
  140.                         {% endif %}
  141.                         <button class="ui grey basic button boton-modal right floated"
  142.                                 data-texto="{{ mensaje_boton }}">
  143.                             {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  144.                         </button>
  145.                     {% endif %}
  146.                 {% elseif isFuture %}
  147.                     {% set mensaje_boton = 'messages.inscripcion.offline'|trans({}, 'FrontendBundle') %}
  148.                     {% if competitionMode == 5 %}
  149.                         {% set mensaje_boton = 'Debe realizar la inscripción en el correo torneos@rfga.org' %}
  150.                     {% endif %}
  151.                     <button class="ui grey basic button boton-modal right floated"
  152.                             data-texto="{{ mensaje_boton }}">
  153.                         {{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
  154.                     </button>
  155.                 {% endif %}
  156.             </div>
  157.             <div class="description">
  158.                 <p></p>
  159.             </div>
  160.         </div>
  161.     </div>
  162. </div>