{% extends 'base_frontend_new.html.twig' %}
{% block title %}{{ circuito.nombre }}{% endblock %}
{% block stylesheets %}
<style>
.aWAGR{
vertical-align: top !important;
}
.diaSemana{
text-transform: capitalize !important;
}
</style>
{% endblock %}
{% block container %}
<div class="ui very padded segment">
<table id="tableComite" class="ui celled striped table">
<thead>
<tr>
<th colspan="{% if circuito.cartel is not empty %}2{% else %}3{% endif %}" class="left aligned">
<h1 class="ui header">
{{ circuito.nombre }}
<div class="sub header">
{% for comite in circuito.comites %}
<div class="ui basic circular disabled large label">
{{ comite.nombre }}
</div>
{% endfor %}
</div>
</h1>
</th>
{% if circuito.cartel is not empty %}
<th class="center aligned">
{% set urlDocu = "https://docs.google.com/viewer?url=" ~ app.request.schemeAndHttpHost ~ app.request.baseUrl ~ "/uploads/circuitos/" ~ circuito.cartel %}
{% if circuito.cartel ends with ".pdf" %}
<a href="{{ urlDocu }}" class="ui big icon button openModal" target="_blank" data-tooltip="{{ 'messages.pdf.see'|trans({'%section%': 'poster'}, 'FrontendBundle') }}" data-variation="inverted" data-position="left center">
<i class="file icon"></i>
</a>
{% else %}
<div class="ui big icon button openModal" data-tooltip="{{ 'messages.pdf.see'|trans({'%section%': 'poster'}, 'FrontendBundle') }}" data-variation="inverted" data-position="left center">
<i class="image icon"></i>
{# <img src="{{ asset("uploads/circuitos/" ~ circuito.cartel) }}" class="ui mini image">#}
</div>
{% endif %}
</th>
{% endif %}
</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>
<tbody>
{% set mesAnt = "0" %}
{% for competicion in competicionesCircuito %}
{% 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"] }}
</div>
</div>
{% if competicion["estado"] == "abierta" and competicion["modo"] == "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 }}
<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">
<div class="ui circular {% if competicion["estado"] == "abierta" and competicion["modo"] == "3"%}blue{% endif %} label">
{{ numInscritos[competicion["id"]][1] }}
</div>
</div>
</td>
</tr>
{% set mesAnt = competicion["fecha"]|date('m') %}
{% endfor %}
</tbody>
</table>
</div>
{% if (circuito.cartel is not empty) and (not (circuito.cartel ends with ".pdf")) %}
<div class="ui cartel modal">
<div class="header">{{ circuito.nombre }}</div>
<div class="content">
<img class="ui fluid image" src="{{ asset("uploads/circuitos/" ~ circuito.cartel) }}">
</div>
<div class="actions">
<div class="ui cancel button">{{ 'buttons.close'|trans({}, 'FrontendBundle') }}</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block javascripts %}
<script>
$(".openModal.button").click(function(e){
$('.cartel.modal').modal('show');
});
</script>
{% endblock %}