templates/frontend/Club/competicionesAbiertas.html.twig line 1

Open in your IDE?
  1. {% extends 'base_frontend_new.html.twig' %}
  2. {% block title %}Listado de Competiciones{% endblock %}
  3. {% block stylesheets %}
  4.     <style>
  5.         .aWAGR{
  6.             vertical-align: top !important;
  7.         }
  8.         .diaSemana{
  9.             text-transform: capitalize !important;
  10.         }
  11.         #tableComite .cambioYear{
  12.             background: #e4e4e4 !important;
  13.             color: black !important;
  14.         }
  15.         {% if movil %}
  16.             #tableComite tr td {
  17.                 text-align: left;
  18.                 padding-left: 0.75em;
  19.             }
  20.         {% endif %}
  21.     </style>
  22. {% endblock %}
  23. {% block container %}
  24.     <div class="ui {% if movil %} basic noPaddingLeft noPaddingRight {% else %} very padded {% endif %}segment">
  25.         <h2 class="ui {% if movil %} center aligned {% endif %} header">
  26.             {{ 'titles.inscripcion.time-limit'|trans({}, 'FrontendBundle') }}
  27.             <span class="ui sub header">{{ cliente.nombre|default("") }}</span>
  28.         </h2>
  29.         <table id="tableComite" class="ui basic padded table">
  30.             {% if not movil %}
  31.             <tr>
  32.                 <th>
  33.                     <span class="mobile hidden">
  34.                         {{ 'comite.fecha'|trans({}, 'FrontendBundle') }}
  35.                     </span>
  36.                 </th>
  37.                 <th>
  38.                     <span class="mobile hidden">
  39.                         {{ 'Competicion'|trans({}, 'FrontendBundle') }}
  40.                     </span>
  41.                 </th>
  42.                 <th></th>
  43.                 <th>
  44.                     <span class="mobile hidden">
  45.                         {{ 'comite.inscrito'|trans({}, 'FrontendBundle') }}
  46.                     </span>
  47.                 </th>
  48.             </tr>
  49.             {% endif %}
  50.             {% if competiciones|length > 0 %}
  51.                 {% set mesAnt = "0" %}
  52.                 {% set yearAnt = "0" %}
  53.                 {% for competicion in competiciones %}
  54.                     {% if competicion.fecha|date('y') != yearAnt and not loop.first %}
  55.                         <tr class="active cambioYear">
  56.                             <td class='center aligned' colspan="4">
  57.                                 {{ (competicion.fecha|date('Y', null, locale))|capitalize }}
  58.                             </td>
  59.                         </tr>
  60.                     {% endif %}
  61.                     {% if competicion.fecha|date('m') != mesAnt %}
  62.                         <tr class="active cambioMes">
  63.                             <td class='center aligned' colspan="4">
  64.                                 {{ competicion.fecha|format_date(pattern='MMMM', locale=locale)|capitalize }}
  65.                             </td>
  66.                         </tr>
  67.                     {% endif %}
  68.                     <tr>
  69.                         <td class="collapsing">
  70.                             <h5 class="ui header">
  71.                                 <div class="content">
  72.                                     {{ (competicion.fecha|format_date(pattern='dd MMM', locale=locale))|capitalize }}
  73.                                     {% set numjor = jornadas[competicion.id] %}
  74.                                     {% if numjor > 1 %}
  75.                                         <span class="ui tiny basic label">
  76.                                             {{ numjor }} {{ 'competicion.clasificacion.rounds'|trans({}, 'FrontendBundle') }}
  77.                                         </span>
  78.                                     {% endif %}
  79.                                     <div class="diaSemana sub header">
  80.                                         {{ competicion.fecha|format_date(pattern='E', locale=locale) }}
  81.                                     </div>
  82.                                 </div>
  83.                             </h5>
  84.                         </td>
  85.                         <td>
  86.                             <h4 class="ui header">
  87.                                 <div class="content">
  88.                                     <a href="{{ path('_tournament', { 'id': competicion.id }) }}">{{ competicion.nombre }}</a>
  89.                                     {% if competicion.wagr == 1 %}
  90.                                         <div class="aWAGR ui tiny right teal basic label" data-tooltip="Puntuable para el World Amateur Golf Ranking" data-position="bottom left">
  91.                                             WAGR
  92.                                         </div>
  93.                                     {% endif %}
  94.                                     <div class="sub header">
  95.                                         {{ competicion.club.nombre }}
  96.                                     </div>
  97.                                 </div>
  98.                                 {% if competicion.inicio|date("U") <= 'now'|date("U") %}
  99.                                     <a href="{{ path('_tournament', { 'id': competicion.id }) }}" class="mobile hidden aInsc ui right floated inverted blue button">Inscripcion</a>
  100.                                 {% endif %}
  101.                             </h4>
  102.                         </td>
  103.                         <td class="center aligned collapsing">
  104.                             {% if competicion.modo.id == 5 %}
  105.                                 {{ 'messages.inscription-by-email'|trans({}, 'FrontendBundle') }}
  106.                             {% else %}
  107.                                 {% if competicion.inicio != null %}
  108.                                     {% if competicion.inicio|date("U") <= 'now'|date("U") %}
  109.                                         {{ 'titles.inscripcion.to'|trans({}, 'FrontendBundle') }} {{ (competicion.fin|format_date(pattern='dd MMM', locale=locale))|capitalize }}
  110.                                     {% elseif 'now'|date("U") <= competicion.inicio|date("U") %}
  111.                                         {{ 'titles.inscripcion.from'|trans({}, 'FrontendBundle') }} {{ (competicion.inicio|format_date(pattern='dd MMM', locale=locale))|capitalize }}
  112.                                     {% else %}
  113.                                         {{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
  114.                                     {% endif %}
  115.                                 {% else %}
  116.                                     {{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
  117.                                 {% endif %}
  118.                             {% endif %}
  119.                         </td>
  120.                         <td class="center aligned collapsing">
  121.                             <div class="mobile hidden">
  122.                                 {% set numIns = numInscritos[competicion.id][1] %}
  123.                                 {% if numIns > 0 %}
  124.                                     <div class="ui circular {% if competicion.estado == "abierta" and competicion.modo.id == "3"%}blue{% endif %} label">
  125.                                         {{ numIns }}
  126.                                     </div>
  127.                                 {% endif %}
  128.                             </div>
  129.                         </td>
  130.                     </tr>
  131.                     {% set mesAnt = competicion.fecha|date('m') %}
  132.                     {% set yearAnt = competicion.fecha|date('y') %}
  133.                 {% endfor %}
  134.             {% else %}
  135.                 <tr>
  136.                     <td class='center aligned' colspan="4">
  137.                         {{ 'error.no-data'|trans({}, 'FrontendBundle') }}
  138.                     </td>
  139.                 </tr>
  140.             {% endif %}
  141.         </table>
  142.     </div>
  143. {% endblock %}
  144. {% block javascripts %}
  145.     {#<script type="text/javascript" src="{{ asset('js/frontend/jquery.table2excel.min.js')}}"></script>#}
  146.     <script src="//cdn.rawgit.com/rainabba/jquery-table2excel/1.1.0/dist/jquery.table2excel.min.js"></script>
  147.     <script>
  148.         $(".export").click(function () {
  149.             $("#tableComite").table2excel({
  150.                 exclude: ".noExl",
  151.                 name: "CompeticionesComite",
  152.                 filename: "CompeticionesComite"
  153.             });
  154.         });
  155.     </script>
  156. {% endblock %}