{% extends 'base_frontend_new.html.twig' %}
{% block title %}Listado de Competiciones{% endblock %}
{% block stylesheets %}
<style>
.aWAGR{
vertical-align: top !important;
}
.diaSemana{
text-transform: capitalize !important;
}
</style>
{% endblock %}
{% block container %}
<div class="mobile only mobileLiveContainer">
<div class="mobileLiveHeader">
<div class="headerLogo">
<svg class="nxt-long-svg" viewBox="-0.5 -0.9 285 40">
<path fill="#fff" d="M63 20L73.8 3.2h-2L62 18.4 52 3.2h-2L61 20 50 36.8h2l10-15.4 10 15.4h2L63 20zM75 3.2V5h11v31.8h1.8V4.9h11V3.2H75zM29.8 35.1V21h17v-1.8h-17V4.9H48V3.2H27.9v33.6h20.2V35H29.7zM190.5 3.2h-11.4v33.6h11.4c6.9 0 11-3.4 11-9.1V12.4c0-5.8-4.1-9.2-11-9.2zm9.2 24.5c0 6.7-6.4 7.4-9.2 7.4h-9.7V4.9h9.7c2.8 0 9.2.8 9.2 7.5v15.3zM21.4 3.2v31.1L2.2 3.3H0v33.5h1.7L1.8 6l19 30.8H23V3.2h-1.7zm203.8 0l-10.7 18.4-10.2-18.2-.1-.2h-2l11.4 20.3v13.3h1.7V23.5l12-20.3h-2.1zm-61.4 0h-11.4v33.6h11.4c6.9 0 11-3.4 11-9.1V12.4c0-5.8-4.1-9.2-11-9.2zm9.2 24.5c0 6.7-6.4 7.4-9.2 7.4h-9.7V4.9h9.7c2.8 0 9.2.8 9.2 7.5v15.3zM137.4 3.2H135l-12.4 33.6h1.9l4.3-11.8h14.7l4.3 11.8h1.9L137.4 3.2zm-7.8 20l6.6-18 6.7 18h-13.3zm-9 8.1v.2c-1.7 2.5-5.2 4-9.2 4-4.9 0-10.1-2.4-10.1-7.7V12.3c0-5.2 5-7.9 10-7.9 4 0 7.7 1.7 9.2 4.3l.2.2 1.5-1-.2-.2c-1.8-3-5.9-5-10.5-5-5.8 0-11.7 3.2-12 9.2v15.8c0 6.3 6 9.6 11.9 9.6 4.6 0 8.7-2 10.6-5l.2-.2-1.5-.8zM284 37.7c-28.4-15-44.3.5-44.3.5V2.7s4.7-7.7 22 2.8c15 9.3 22 5.6 22 5.6s.5 3.6-1 9c-2 7 1.3 17.5 1.3 17.5"></path>
</svg>
</div>
</div>
</div>
<div class="ui very padded segment basicMobile noPaddingMobile">
<div id="anioCompeticion" class="ui selection dropdown competicionSelect" data-clase="Competicion">
<div class="default text" data-value="{{ anio }}">{{ anio }} </div>
<i class="dropdown icon"></i>
<div class="menu">
{% for i in ('now'|date('Y') + 1)..2013 %}
<div class="item">
{{ i }}
</div>
{% endfor %}
</div>
</div>
<button class="ui basic icon button export">
<i class="icon">
<svg fill="currentColor" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 31.425 31.426" style="enable-background:new 0 0 31.425 31.426;" xml:space="preserve">
<path d="M11.15,0L3.011,8.592v22.834h25.403V0H11.15z M10.434,3.613v3.808H6.826L10.434,3.613z M26.449,29.462H4.977V9.385h7.421 V1.964h14.053v27.498H26.449z"/>
<path d="M15.004,14.766h0.491v-1.768H9.444v1.768h0.737c0.202,0,0.402,0.055,0.617,0.168c0.203,0.107,0.396,0.306,0.572,0.585
l2.919,4.738l-2.939,4.21c-0.16,0.229-0.306,0.421-0.438,0.576c-0.113,0.133-0.228,0.242-0.337,0.321
c-0.098,0.07-0.198,0.119-0.307,0.148c-0.127,0.034-0.282,0.051-0.462,0.051H9.198v1.769h5.438v-1.276l-0.055-0.49H14.09
c-0.449,0-0.643-0.057-0.724-0.094c0-0.053,0.01-0.115,0.028-0.186c0.024-0.088,0.055-0.176,0.095-0.264
c0.043-0.097,0.087-0.188,0.138-0.279c0.046-0.084,0.091-0.159,0.139-0.229l1.65-2.44l1.769,2.843
c0.068,0.114,0.123,0.209,0.159,0.289c0.036,0.077,0.05,0.121,0.054,0.139l0.013,0.108c0,0-0.112,0.113-0.625,0.113h-0.592v1.768
h6.033v-1.768h-0.729c-0.144,0-0.3-0.052-0.464-0.151c-0.133-0.08-0.35-0.259-0.616-0.613l-3.272-5.259l2.529-3.646
c0.164-0.238,0.314-0.437,0.452-0.594c0.125-0.142,0.246-0.26,0.362-0.349c0.092-0.069,0.182-0.116,0.272-0.142
c0.104-0.03,0.226-0.045,0.361-0.045h0.655v-1.768h-5.074v1.277l0.055,0.491h0.491c0.125,0,0.237,0.006,0.341,0.02
c0.091,0.011,0.145,0.029,0.173,0.029h0.001c0,0.1-0.027,0.213-0.085,0.336c-0.075,0.168-0.176,0.346-0.301,0.535l-1.349,2.051
l-1.287-2.08c-0.095-0.15-0.17-0.276-0.222-0.375c-0.047-0.09-0.083-0.168-0.107-0.231c-0.017-0.046-0.029-0.087-0.033-0.113
c-0.006-0.039-0.009-0.08-0.031-0.089c0.002-0.001,0.042-0.025,0.162-0.049C14.628,14.776,14.775,14.766,15.004,14.766z"/>
</svg>
</i>
</button>
<i id="loading" class="spinner loading large icon" style="display:none"></i>
<form method="POST" autocomplete="off">
<input type="hidden" name ="anio" id="anio">
</form>
<table id="tableComite" class="ui celled striped table">
<thead>
<tr>
<th colspan="3" class="center aligned">
<h1 class="ui header">
{{ club.nombre }}
</h1>
</th>
</tr>
<tr>
<th>
<div class="mobile hidden">
{{ 'Competicion'|trans({}, 'FrontendBundle') }}
</div>
</th>
<th>
<div class="mobile hidden">
{{ 'comite.fecha'|trans({}, 'FrontendBundle') }}
</div>
</th>
<th>
<div class="mobile hidden">
{{ 'comite.inscrito'|trans({}, 'FrontendBundle') }}
</div>
</th>
</tr>
</thead>
{% set mesAnt = "0" %}
{% for competicion in competiciones %}
{% if competicion.fecha|date('m') != mesAnt %}
<tr class="active cambioMes">
<td colspan="3">
{{ (competicion.fecha|format_date(pattern='MMMM', locale=locale))|capitalize }}
</td>
</tr>
{% endif %}
<tr>
<td>
<h4 class="ui header">
<div class="content">
<a href="{{ path('_tournament', { 'id': competicion.id }) }}">
{% if "cancelada" != competicion.estado %}
{{ competicion.nombre }}
{% else %}
<em><s><span class="ui grey text">{{ competicion.nombre }}</span></s></em>
{% endif %}
</a>
{% if competicion.wagr == "1"%}
<div class="aWAGR ui tiny right teal basic label" data-tooltip="Puntuable para el World Amateur Golf Ranking" data-position="bottom left">
WAGR
</div>
{% endif %}
<div class="sub header">
{{ competicion.club.nombre}}
</div>
</div>
{% if competicion.estado == "abierta" and competicion.modo.id == "3"%}
<a href="{{ path('_tournament', { 'id': competicion.id }) }}" class="mobile hidden aInsc ui right floated inverted blue button">Inscripcion</a>
{% endif %}
</h4>
</td>
<td class="collapsing">
<h4 class="ui{% if competicion.fecha|date('Ymd') < 'now'|date('Ymd') %} disabled {% endif %}header">
<div class="content">
{{ (competicion.fecha|format_date(pattern='dd MMM yyyy', locale=locale))|capitalize }}
{% set numjor = jornadas[competicion.id] %}
{% if numjor > 1 %}
<span class="ui tiny basic label">
{{ numjor }} {{ 'competicion.clasificacion.rounds'|trans({}, 'FrontendBundle') }}
</span>
{% endif %}
<div class="diaSemana sub header">
{{ competicion.fecha|format_date(pattern='E', locale=locale) }}
</div>
</div>
</h4>
</td>
<td class="center aligned collapsing">
<div class="mobile hidden">
{% set numIns = numInscritos[competicion.id][1] %}
{% if numIns > 0 %}
<div class="ui circular {% if competicion.estado == "abierta" and competicion.modo.id == "3"%}blue{% endif %} label">
{{ numIns }}
</div>
{% endif %}
</div>
</td>
</tr>
{% set mesAnt = competicion.fecha|date('m') %}
{% endfor %}
</table>
</div>
{% endblock %}
{% block javascripts %}
<script type="text/javascript" src="{{ asset('js/frontend/jquery.table2excel.min.js')}}"></script>
<script>
$(".dropdown").dropdown({
onChange: function (value, text, $choice) {
$('#loading').show();
$("#anio").val(value);
$("form").submit();
}
});
$(".export").click(function () {
$("#tableComite").table2excel({
exclude: ".noExl",
name: "CompeticionesComite",
filename: "CompeticionesComite"
});
});
</script>
{% endblock %}