{% set numplazas = competicion.plazas - num_inscritos %}
{% set clase_plazas = 'green' %}
{% set isOffline = (competicion.modo.id == 2) %}
{% if numplazas <= 0 %}
{% set clase_plazas = 'red' %}
{% endif %}
{% if (competicion.modo.id >= 3) %}
<div class="ui secondary basic segment mobile only">
<!-- HACER SEGMENTO -->
<h4 class="ui header">
Plazas disponibles
{% if competicion.mostrarPlazas %}
<div class="ui small circular basic label {{ clase_plazas }}">
{% if competicion.organizador.id != "AM00" %}
{{ numplazas }}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
</div>
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
</h4>
</div>
{% set oculto = "" %}
{% set rutaInsc = app.request.attributes.get('_route') %}
{% if ((competicion.fin|date('Y-m-d') < "now"|date('Y-m-d')) or (rutaInsc == 'competicion_inscritos_new' or rutaInsc == 'competicion_inscritos_pareja_new')) %}
{% set oculto = "mobile hidden" %}
{% endif %}
<div class="ui attached segment {{ oculto }} messagesBlock">
{% if competicion.social and competicion.estado == 'abierta' %}
<div class="ui orange top right attached label">
{{ 'messages.inscripcion.social'|trans({}, 'FrontendBundle') }}
</div>
{% endif %}
<div class="ui grid stackable container">
<div class="five wide column">
<h4 class="ui header slab verydisabled">{{ 'titles.fare'|trans({}, 'FrontendBundle') }}</h4>
{% if not competicion.tarifaReglamento %}
{% for tar in tarifas %}
<p class="grisCursiva">{{ tar.nombre }}: <span
class="ui small circular verydisabled label">{{ tar.importe }} €</span></p>
{% endfor %}
{% else %}
<div class="ui circular label">{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}</div>
{% endif %}
</div>
<div class="six wide column grisCursiva">
<h4 class="ui header slab verydisabled">{{ 'titles.time-limit'|trans({}, 'FrontendBundle') }} (hora local)</h4>
{% if competicion.inicio != null %}
<i class="unlock disabled grey icon"></i>
<span>{{ competicion.inicio|date('d/m/y', competicion.club.timezone.nombre) }} </span>
<i class="wait disabled grey icon"></i>
<span>{{ competicion.inicio|date('H:i', competicion.club.timezone.nombre) }}</span>
{% endif %}
{% if competicion.fin != null %}
<i class="lock disabled grey icon"></i>
<span>{{ competicion.fin|date('d/m/y', competicion.club.timezone.nombre) }}</span>
<i class="wait disabled grey icon"></i>
<span>{{ competicion.fin|date('H:i', competicion.club.timezone.nombre) }}</span>
{% endif %}
</div>
<div class="five wide middle aligned column">
{% if competicion.estado == 'abierta' and (not competicion.inicio is null) and competicion.modo.id != 5 %}
{% set lic = app.request.get('lic')|default('') %}
{% set email = app.request.get('email')|default('') %}
{% set clase_inscripcion = "disabled" %}
{% set plazas_disponibles = competicion.plazas - num_inscritos %}
{% if (
(
((plazas_disponibles <= 0) and competicion.listaEspera) or (plazas_disponibles > 0)
)
and (
'now'|date("U") >= competicion.inicio|date("U") and 'now'|date("U") < competicion.fin|date("U")
)
) %}
{% set clase_inscripcion = "blue" %}
{% endif %}
{% if competicion.jugadores == 1 %}
<a class="ui animated fluid {{ clase_inscripcion }} middle aligned button" tabindex="0"
href="{{ path('competicion_inscritos_new', {'id': competicion.id }) }}?lic={{ lic }}&email={{ email }}#insc{{ competicion.id }}">
<div class="visible content">
{% if (plazas_disponibles > 0) %}
{{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
{% elseif ((plazas_disponibles <= 0) and competicion.listaEspera) %}
{{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
{% else %}
{{ 'competicion.inscritos.no_available'|trans({}, 'FrontendBundle') }}
{% endif %}
</div>
<div class="hidden content">
Plazas disponibles:
{% if competicion.mostrarPlazas %}
{% if competicion.organizador.id != "AM00" %}
{{ numplazas }}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
</div>
</a>
{% elseif competicion.jugadores == 2 %}
<a href="{{ path('competicion_inscritos_pareja_new', {'id': competicion.id }) }}?lic={{ lic }}&email={{ email }}#insc{{ competicion.id }}"
class="{{ clase_inscripcion }}">
<div class="ui animated fluid {{ clase_inscripcion }} button" tabindex="0">
<div class="visible content">
{{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
</div>
<div class="hidden content">
Plazas disponibles:
{% if competicion.mostrarPlazas %}
{% if competicion.organizador.id != "AM00" %}
{{ numplazas }}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
</div>
</div>
</a>
{% elseif competicion.jugadores > 2 %}
<a href="{{ path('competicion_inscritos_equipo_new', {'id': competicion.id }) }}?lic={{ lic }}&email={{ email }}#insc{{ competicion.id }}"
class="{{ clase_inscripcion }}">
<div class="ui animated fluid {{ clase_inscripcion }} button" tabindex="0">
<div class="visible content">
{{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
</div>
<div class="hidden content">
Plazas disponibles:
{% if competicion.mostrarPlazas %}
{% if competicion.organizador.id != "AM00" %}
{{ numplazas }}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
{% else %}
{{ 'messages.segun-reglamento'|trans({}, 'FrontendBundle') }}
{% endif %}
</div>
</div>
</a>
{% endif %}
{% else %}
{% set mensaje_boton = 'messages.inscripcion.sinPlazo'|trans({}, 'FrontendBundle') %}
{% if competicion.estado == 'congelada' %}
{% set mensaje_boton = 'messages.inscripcion.congelada'|trans({}, 'FrontendBundle') %}
{% elseif competicion.estado == 'cancelada' %}
{% set mensaje_boton = 'messages.inscripcion.cancelada'|trans({}, 'FrontendBundle') %}
{% elseif competicion.estado == 'finalizada' %}
{% set mensaje_boton = 'messages.inscripcion.finalizada'|trans({}, 'FrontendBundle') %}
{% endif %}
{% if competicion.modo.id == 5 %}
{% set mensaje_boton = 'Debe realizar la inscripción en el correo ' ~ (competicion.organizador.getEmpleadoTipo(7).emailCod|decod(secret))|default(competicion.organizador.user.email) %}
{% endif %}
<button class="ui grey basic fluid button boton-modal right floated"
data-texto="{{ mensaje_boton }}">
{{ 'competicion.inscritos.inscripcion'|trans({}, 'FrontendBundle') }}
</button>
<div class="ui page dimmer" id="dimmerEstado">
<div class="content">
<h2 class="center">
<i class="info circle icon"></i>
<span id="modal-text"></span>
</h2>
<h2 class="center">
{{ 'messages.inscripcion.abiertas'|trans({}, 'FrontendBundle') }} <a
href="{{ path('competiciones_abiertas', {id: competicion.organizador.id }) }}">{{ 'competiciones'|trans({}, 'FrontendBundle')|lower }}</a>
</h2>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% elseif isOffline %}
<div class="ui attached segment messagesBlock">
<div class="ui grid">
<div class="five wide right floated column">
<button class="ui fluid basic black disabled button" type="button">
{{ 'competicion.inscritos.inscriptionInClub'|trans({}, 'FrontendBundle') }}
</button>
</div>
</div>
</div>
{% endif %}
{# Se elimina condicion de mostrado del message del covid
{% if ((competicion.showLiveScoring == "publico" and algunaHoy) or (is_granted('ROLE_ADMIN') and algunaHoy) or (competicion.showLiveScoring == "club" and is_granted('ROLE_CLUB') and algunaHoy) or (competicion.showLiveScoring == "federacion" and is_granted('ROLE_FEDE') and algunaHoy)) or (competicion.aviso is not null or competicion.aviso is not empty) or (competicion.observaciones is not null and competicion.observaciones|trim != "") or (competicion.premios is not null and competicion.premios|trim != "") or (competicion.informacion != null) or (competicion.organizador.id == "AM00") %} #}
{% if ((competicion.showLiveScoring == "publico" and algunaHoy) or (is_granted('ROLE_ADMIN') and algunaHoy) or (competicion.showLiveScoring == "club" and is_granted('ROLE_CLUB') and algunaHoy) or (competicion.showLiveScoring == "federacion" and is_granted('ROLE_FEDE') and algunaHoy)) or (competicion.aviso is not null or competicion.aviso is not empty) or (competicion.observaciones is not null and competicion.observaciones|trim != "") or (competicion.premios is not null and competicion.premios|trim != "") or (competicion.informacion != null) %}
<div class="ui attached segment messagesBlock">
{% if competicion.formula.id not in ['P', 'R'] and (((competicion.showLiveScoring == "publico" and algunaHoy) or (is_granted('ROLE_ADMIN') and algunaHoy) or (competicion.showLiveScoring == "club" and is_granted('ROLE_CLUB') and algunaHoy) or (competicion.showLiveScoring == "federacion" and is_granted('ROLE_FEDE') and algunaHoy))) %}
{% set urlLiveScoring = url('livescoring', {'id': competicion.id}) %}
{% include 'frontend/Default/liveScoringAlert.html.twig' with {'data': urlLiveScoring } %}
{% endif %}
{# Se elimina COVID de la inscripción AM00 - NEX-1838
{% if competicion.organizador.id == "AM00" %}
<div class="ui warning icon message messageShadow">
<i class="edit outline large icon"></i>
<div class="content">
<div class="header">
{{ 'messages.competicion.covid-title'|trans({}, 'FrontendBundle') }}
</div>
<div class="textoAviso">
{{ 'messages.competicion.covid-body'|trans({}, 'FrontendBundle')|raw }}
</div>
</div>
</div>
{% endif %} #}
{% if competicion.aviso is not null or competicion.aviso is not empty %}
{% include 'frontend/Default/infoPanels/notice-panel-dropdown.html.twig' with {'data': competicion.aviso} %}
{% endif %}
{% if competicion.observaciones is not null and competicion.observaciones|trim != "" %}
{% include 'frontend/Default/infoPanels/observations-panel-dropdown.html.twig' with {'data': competicion.observaciones} %}
{% endif %}
{% if competicion.informacion != null %}
{% include 'frontend/Default/infoPanels/info-panel-dropdown.html.twig' with {'data': competicion.informacion} %}
{% endif %}
{% if competicion.premios != null %}
{% include 'frontend/Default/infoPanels/awards-panel-dropdown.html.twig' with {'data': competicion.premios} %}
{% endif %}
</div>
{% endif %}
{% if clima is defined and clima is not empty %}
{% set elements = ["first", "second"] %}
<div class="ui top attached tabular menu climatologia">
{% for cli in clima %}
{% set active = "" %}
{% if loop.first %}
{% set active = "active" %}
{% endif %}
<a class="item {{ active }}"
data-tab="{{ elements[loop.index0] }}">{{ cli["fecha"]|format_date(pattern='E', locale=locale) }}</a>
{% endfor %}
</div>
{% for cli in clima %}
{% set active = "" %}
{% if loop.first %}
{% set active = "active" %}
{% endif %}
<div class="ui bottom attached {{ active }} tab segment climatologia messageBlock"
data-tab="{{ elements[loop.index0] }}">
<div class="ui message messageShadow">
<div class="content">
{# <div class="ui fitted divider hidden"></div>
<div class="ui disabled small {% if cli.horario is defined and cli.horario is empty %}center aligned{% endif %} header">
<i class="info grey disabled circle icon"></i>
{{ cli.summary }}
</div> #}
{# <div class="ui {% if not cli.horario is empty %}fitted{% endif %} divider hidden"></div> #}
{# <div class="ui fitted divider hidden"></div> #}
{% if cli.horario is defined and cli.horario is empty %}
<div class="ui equal width grid divided middle aligned weathertext">
<div class="center aligned column mobile hidden">
<svg class="noWidth" width="39" height="39" xmlns="http://www.w3.org/2000/svg"
>
<g fill="#ddd">
<g stroke="null"
transform="matrix(0.7916406393051147,0,0,0.7916406393051147,-0.20773422856450452,6.4587236917304836)"
id="svg_9">
<svg stroke="null" viewBox="0 0 100 100" height="100px" width="100px"
y="-35.7368" x="-25.7368" id="svg_8"
xmlns="http://www.w3.org/2000/svg">
<g stroke="null" id="svg_3">
<g stroke="null" id="svg_4">
<path stroke="null" id="svg_5"
d="m38.688,41.859l-2.828,-2.828c-0.781,-0.78 -2.047,-0.78 -2.828,0c-0.781,0.781 -0.781,2.047 0,2.828l2.828,2.828c0.781,0.781 2.047,0.781 2.828,0c0.781,-0.781 0.781,-2.046 0,-2.828zm33.309,12.141l-3.999,0c-1.104,0 -1.999,0.896 -1.999,2s0.895,2 1.999,2l3.999,0c1.105,0 2,-0.896 2,-2s-0.894,-2 -2,-2zm-39.994,0l-4,0c-1.104,0 -2,0.896 -2,2s0.896,2 2,2l4,0c1.104,0 2,-0.896 2,-2s-0.897,-2 -2,-2zm27.996,9.999l-19.998,0c-1.104,0 -1.999,0.896 -1.999,2s0.896,1.999 1.999,1.999l19.998,0c1.104,0 2,-0.895 2,-1.999s-0.895,-2 -2,-2zm6.97,-24.968c-0.78,-0.78 -2.048,-0.78 -2.828,0l-2.828,2.828c-0.78,0.781 -0.78,2.047 0,2.828c0.781,0.781 2.048,0.781 2.828,0l2.828,-2.828c0.78,-0.781 0.78,-2.047 0,-2.828zm-16.968,0.971c1.104,0 1.999,-0.896 1.999,-2l0,-3.999c0,-1.104 -0.896,-2 -1.999,-2c-1.105,0 -2,0.896 -2,2l0,3.999c0,1.104 0.895,2 2,2zm0,4c-6.627,0 -11.999,5.371 -11.999,11.998c0,1.404 0.254,2.747 0.697,3.999l4.381,0c-0.683,-1.177 -1.079,-2.54 -1.079,-3.999c0,-4.418 3.582,-7.999 8,-7.999c4.417,0 7.998,3.581 7.998,7.999c0,1.459 -0.396,2.822 -1.078,3.999l4.381,0c0.443,-1.252 0.697,-2.595 0.697,-3.999c0,-6.627 -5.372,-11.998 -11.998,-11.998zm0,16.247c0.552,0 0.999,-0.447 0.999,-1l0,-3.827l2.536,2.535c0.39,0.391 1.023,0.391 1.414,0c0.39,-0.391 0.39,-1.023 0,-1.414l-4.242,-4.242c-0.391,-0.391 -1.024,-0.391 -1.414,0l-4.242,4.242c-0.391,0.391 -0.391,1.023 0,1.414s1.023,0.391 1.414,0l2.535,-2.535l0,3.827c0,0.553 0.447,1 1,1z"
clip-rule="evenodd" fill-rule="evenodd"/>
</g>
</g>
</svg>
</g>
</g>
</svg>
<span class="suntimes">
{{ cli.sunriseTime is defined and cli.sunriseTime|date("H:i", competicion.club.timezone ? competicion.club.timezone.nombre : default_timezone_get()) }}
</span>
<svg class="noWidth" width="39" height="39" xmlns="http://www.w3.org/2000/svg"
>
<path fill="#ddd" stroke="null" id="svg_7"
d="m36.67492,25.88526l-3.14573,0c-0.86822,0 -1.57208,-0.70464 -1.57208,-1.57286s0.70386,-1.57286 1.57208,-1.57286l3.14573,0c0.86822,0 1.57208,0.70464 1.57208,1.57286s-0.70307,1.57286 -1.57208,1.57286zm-6.17821,-10.46898c-0.6142,0.6142 -1.61061,0.6142 -2.22403,0c-0.6142,-0.6142 -0.6142,-1.60983 0,-2.22403l2.22403,-2.22403c0.61342,-0.61342 1.60983,-0.61342 2.22324,0c0.6142,0.6142 0.6142,1.60983 0,2.22403l-2.22324,2.22403zm-2.23347,12.04105l-3.44536,0c0.53635,-0.92563 0.84777,-1.99754 0.84777,-3.14494c0,-3.47445 -2.81621,-6.29067 -6.28988,-6.29067c-3.47445,0 -6.29145,2.81621 -6.29145,6.29067c0,1.1474 0.31221,2.21931 0.84935,3.14494l-3.44614,0c-0.34839,-0.98461 -0.54814,-2.04079 -0.54814,-3.14494c0,-5.21168 4.22471,-9.43561 9.43639,-9.43561c5.2109,0 9.43561,4.22392 9.43561,9.43561c0,1.10415 -0.19975,2.16033 -0.54814,3.14494zm-8.88746,-15.72627c-0.86901,0 -1.57286,-0.70464 -1.57286,-1.57286l0,-3.14494c0,-0.86822 0.70386,-1.57286 1.57286,-1.57286c0.86822,0 1.57286,0.70464 1.57286,1.57286l0,3.14494c0,0.86822 -0.70543,1.57286 -1.57286,1.57286zm-11.12093,3.68522l-2.22403,-2.22403c-0.6142,-0.6142 -0.6142,-1.60983 0,-2.22403c0.6142,-0.61342 1.60983,-0.61342 2.22403,0l2.22403,2.22403c0.6142,0.6142 0.6142,1.60983 0,2.22403s-1.60904,0.6142 -2.22403,0zm-1.4604,8.89611c0,0.86822 -0.70464,1.57286 -1.57286,1.57286l-3.14573,0c-0.86822,0 -1.57286,-0.70464 -1.57286,-1.57286s0.70464,-1.57286 1.57286,-1.57286l3.14573,0c0.86822,0 1.57286,0.70464 1.57286,1.57286zm12.58133,-3.14573c0.43411,0 0.78643,0.35232 0.78643,0.78643l0,3.01046l1.9936,-1.9936c0.30749,-0.30749 0.80452,-0.30749 1.11201,0s0.30749,0.80452 0,1.11201l-3.33604,3.33604c-0.30749,0.30749 -0.80452,0.30749 -1.11201,0l-3.33604,-3.33604c-0.30749,-0.30749 -0.30749,-0.80452 0,-1.11201s0.80452,-0.30749 1.11201,0l1.9936,1.9936l0,-3.01046c0,-0.43411 0.35153,-0.78643 0.78643,-0.78643zm-7.86353,9.43639l15.72627,0c0.86822,0 1.57286,0.70464 1.57286,1.57286s-0.70464,1.57208 -1.57286,1.57208l-15.72627,0c-0.86822,0 -1.57286,-0.70386 -1.57286,-1.57208s0.70386,-1.57286 1.57286,-1.57286z"
clip-rule="evenodd" fill-rule="evenodd"/>
</svg>
<span class="suntimes">
{{ cli.sunsetTime is defined and cli.sunsetTime|date("H:i", competicion.club.timezone ? competicion.club.timezone.nombre : default_timezone_get()) }}
</span>
</div>
<div class="center aligned column">
{# tomamos la temperatura mas cercana por abajo #}
{% if cli.horario is defined and cli.horario is not empty %}
{% set enc = false %}
{% set valorTemp = cli.horario[0].clima.temperature|number_format(0, '','') %}
{% for horario in cli.horario %}
{# buscamos la mas cercana a la actual #}
{% if horario.fecha|date("H") == "now"|date('H') %}
{% set valorTemp = horario.clima.temperature|number_format(0, '','') %}
{% set enc = true %}
{% endif %}
{# tomamos la temperatura mas cercana por arriba #}
{% if not enc %}
{% set valorTemp = cli.horario[cli.horario|length - 1].clima.temperature|number_format(0, '','') %}
{% endif %}
{% endfor %}
{# controlamos para que no salga -0 al redondear #}
{% if valorTemp < 1 and valorTemp > -1 %}
{% set valorTemp = 0 %}
{% endif %}
<span class="emph">{{ valorTemp }}º</span>
{% endif %}
<span class="skyicon">
{% if cli.conditionCode is defined and cli.conditionCode is not empty %}
<i class="ui large grey icon">
{# <canvas class="{{ cli.conditionCode }}" width="35" height="35">
</canvas> #}
{% include 'FrontendBundle:Climacon:' ~ cli.conditionCode ~ '.html.twig' ignore missing %}
</i>
{% endif %}
</span>
{% if cli.precipitationChance is defined and ((cli.precipitationChance * 100) < 15) %}
<span class="windtext">{{ cli.windSpeed|number_format(0, '', '') }}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="4 0 24 16">
<path d="M11 10H0V8h11c.55 0 1-.45 1-1s-.45-1-1-1c-.4 0-.75.24-.9.6l-1.75-.97C8.85 4.67 9.85 4 11 4c3.97 0 3.97 6 0 6zm7 7c0-1.66-1.34-3-3-3H0v2h15c.55 0 1 .45 1 1s-.45 1-1 1c-.4 0-.75-.24-.9-.6l-1.75.97c.5.96 1.5 1.63 2.65 1.63 1.66 0 3-1.34 3-3zm1-7.66c.1-.75.73-1.34 1.5-1.34.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5H0v2h20.5c1.93 0 3.5-1.57 3.5-3.5S22.43 6 20.5 6c-1.62 0-2.98 1.12-3.37 2.62l1.88.73z"/>
</svg>
</span>
{% endif %}
</div>
<div class="center aligned column">
<span class="min">{{ cli.temperatureMin|number_format(0, '','') }}º</span>
<span class="windtext">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="24" viewBox="-2 0 18 22">
<path d="M7.65 4.34v6.78c0 1.42-.46 2.06-1.27 2.75-.9.77-1.43 1.9-1.43 3.08C4.95 19.2 6.75 21 9 21c2.23 0 4.05-1.8 4.05-4.05 0-1.18-.52-2.3-1.43-3.08-.8-.7-1.27-1.34-1.27-2.75V4.35C10.35 3.6 9.75 3 9 3s-1.35.6-1.35 1.33zm4.5 0v6.78c0 .53.23 1.03.64 1.38 1.23 1.07 2.03 2.67 2.03 4.45 0 3.24-2.62 5.86-5.85 5.86-3.25 0-5.87-2.6-5.87-5.83 0-1.78.8-3.38 2.08-4.45.4-.34.65-.84.65-1.37v-6.8C5.85 2.6 7.25 1.2 9 1.2s3.15 1.4 3.15 3.13zm0 12.6c0 1.75-1.4 3.16-3.15 3.16s-3.15-1.4-3.15-3.15c0-1.02.54-1.87 1.25-2.5.9-.8 1.45-1.56 1.45-2.9v-.45h.9v.45c0 1.34.54 2.1 1.45 2.9.7.63 1.25 1.48 1.25 2.5z"/>
</svg>
</span>
<span class="max">{{ cli.temperatureMax|number_format(0, '','') }}º</span>
</div>
{% if cli.precipitationChance is defined and cli.precipitationChance != 0 %}
<div class="center aligned column ">
<span class="raintext">{{ (100 * cli.precipitationChance)|number_format(0, '', '') }}%</span>
<svg class="windtext" xmlns="http://www.w3.org/2000/svg" width="18" height="18"
viewBox="0 0 24 24">
<path d="M13 2.06V1c0-.55-.45-1-1-1s-1 .45-1 1v1.05c-6.92.52-10.37 5.6-11 9.9 1.86-2.67 6.14-2.67 8 0 1.84-2.63 6.05-2.68 7.92 0 1.86-2.67 6.22-2.67 8.08 0-.63-4.28-4.13-9.32-11-9.9zm0 10.1V21c0 1.66-1.34 3-3 3s-3-1.34-3-3v-1h2v1c0 .55.45 1 1 1s1-.45 1-1v-8.87c.68-.22 1.27-.24 2 .03z"/>
</svg>
</div>
{% endif %}
</div>
{% else %}
<div class="ui equal width grid divided middle aligned weathertext mobile only">
<div class="center aligned column">
{# tomamos la temperatura mas cercana por abajo #}
{% if cli.horario is defined and cli.horario is not empty %}
{% set enc = false %}
{% set valorTemp = cli.horario[0].clima.temperature|number_format(0, '','') %}
{% for horario in cli.horario %}
{# buscamos la mas cercana a la actual #}
{% if horario.fecha|date("H") == "now"|date('H') %}
{% set valorTemp = horario.clima.temperature|number_format(0, '','') %}
{% set enc = true %}
{% endif %}
{# tomamos la temperatura mas cercana por arriba #}
{% if not enc %}
{% set valorTemp = cli.horario[cli.horario|length - 1].clima.temperature|number_format(0, '','') %}
{% endif %}
{% endfor %}
<span class="emph">{{ valorTemp }}º</span>
{% endif %}
<span class="skyicon mobile hidden">
{# <canvas class="{{ cli.conditionCode }}" width="35" height="35">
</canvas> #}
{% if cli.conditionCode is defined and cli.conditionCode is not empty %}
<i class="ui small grey icon">
{# <canvas class="{{ cli.conditionCode }}" width="35" height="35">
</canvas> #}
{% include 'FrontendBundle:Climacon:' ~ cli.conditionCode ~ '.html.twig' ignore missing %}
</i>
{% endif %}
</span>
{% if cli.precipitationChance is defined and ((cli.precipitationChance * 100) < 15) %}
<span class="windtext">{{ cli.windSpeed|number_format(0, '', '') }}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="4 0 24 16">
<path d="M11 10H0V8h11c.55 0 1-.45 1-1s-.45-1-1-1c-.4 0-.75.24-.9.6l-1.75-.97C8.85 4.67 9.85 4 11 4c3.97 0 3.97 6 0 6zm7 7c0-1.66-1.34-3-3-3H0v2h15c.55 0 1 .45 1 1s-.45 1-1 1c-.4 0-.75-.24-.9-.6l-1.75.97c.5.96 1.5 1.63 2.65 1.63 1.66 0 3-1.34 3-3zm1-7.66c.1-.75.73-1.34 1.5-1.34.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5H0v2h20.5c1.93 0 3.5-1.57 3.5-3.5S22.43 6 20.5 6c-1.62 0-2.98 1.12-3.37 2.62l1.88.73z"/>
</svg>
</span>
{% endif %}
</div>
<div class="center aligned column">
<span class="min">{{ cli.temperatureMin|number_format(0, '','') }}º</span>
<span class="windtext">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="24" viewBox="-2 0 18 22">
<path d="M7.65 4.34v6.78c0 1.42-.46 2.06-1.27 2.75-.9.77-1.43 1.9-1.43 3.08C4.95 19.2 6.75 21 9 21c2.23 0 4.05-1.8 4.05-4.05 0-1.18-.52-2.3-1.43-3.08-.8-.7-1.27-1.34-1.27-2.75V4.35C10.35 3.6 9.75 3 9 3s-1.35.6-1.35 1.33zm4.5 0v6.78c0 .53.23 1.03.64 1.38 1.23 1.07 2.03 2.67 2.03 4.45 0 3.24-2.62 5.86-5.85 5.86-3.25 0-5.87-2.6-5.87-5.83 0-1.78.8-3.38 2.08-4.45.4-.34.65-.84.65-1.37v-6.8C5.85 2.6 7.25 1.2 9 1.2s3.15 1.4 3.15 3.13zm0 12.6c0 1.75-1.4 3.16-3.15 3.16s-3.15-1.4-3.15-3.15c0-1.02.54-1.87 1.25-2.5.9-.8 1.45-1.56 1.45-2.9v-.45h.9v.45c0 1.34.54 2.1 1.45 2.9.7.63 1.25 1.48 1.25 2.5z"/>
</svg>
</span>
<span class="max">{{ cli.temperatureMax|number_format(0, '','') }}º</span>
</div>
{% if cli.precipitationChance is defined and cli.precipitationChance != 0 %}
<div class="center aligned column ">
<span class="raintext">{{ (100 * cli.precipitationChance)|number_format(0, '', '') }}%</span>
<svg class="windtext" xmlns="http://www.w3.org/2000/svg" width="18" height="18"
viewBox="0 0 24 24">
<path d="M13 2.06V1c0-.55-.45-1-1-1s-1 .45-1 1v1.05c-6.92.52-10.37 5.6-11 9.9 1.86-2.67 6.14-2.67 8 0 1.84-2.63 6.05-2.68 7.92 0 1.86-2.67 6.22-2.67 8.08 0-.63-4.28-4.13-9.32-11-9.9zm0 10.1V21c0 1.66-1.34 3-3 3s-3-1.34-3-3v-1h2v1c0 .55.45 1 1 1s1-.45 1-1v-8.87c.68-.22 1.27-.24 2 .03z"/>
</svg>
</div>
{% endif %}
</div>
<div class="ui padded grid mobile hidden">
<div class="sixteen wide column">
<div class="ui equal width center aligned grid timetext">
<div class="column emph">
<b>
{{ cli.sunriseTime is defined and cli.sunriseTime|date("H:i", competicion.club.timezone ? competicion.club.timezone.nombre : default_timezone_get()) }}
</b>
</div>
{% for horario in cli.horario|default([]) %}
<div class="column">
{{ horario.fecha|date("G") }}
</div>
{% endfor %}
<div class="column emph">
<b>
{{ cli.sunsetTime|date("H:i", competicion.club.timezone ? competicion.club.timezone.nombre : default_timezone_get()) }}
</b>
</div>
</div>
{% set maxClass = "" %}
{% set minClass = "" %}
{# este es el grid para version ordenador #}
<div class="ui equal width center aligned grid tempbg temptext">
{% if cli.posMin == -1 %}
{% set minClass = "min emph" %}
{% endif %}
{# controlamos para que no salga -0 al redondear #}
{% set valorTemp = cli.primera.temperature %}
{% if valorTemp < 1 and valorTemp > -1 %}
{% set valorTemp = 0 %}
{% endif %}
<div class="column {{ minClass }}">{{ valorTemp|number_format(0, '', '') }}º</div>
{% for horario in cli.horario|default([]) %}
{% set maxClass = "" %}
{% set minClass = "" %}
{% if cli.posMin == loop.index0 %}
{% set minClass = "min emph" %}
{% endif %}
{% if cli.posMax == loop.index0 %}
{% set maxClass = "max emph" %}
{% endif %}
{% set valTemp = horario.clima.temperature %}
{% if valTemp < 1 and valTemp > -1 %}
{% set valTemp = 0 %}
{% endif %}
<div class="column {{ minClass }} {{ maxClass }}">{{ valTemp|number_format(0, '','') }}
º
</div>
{% endfor %}
{% set valorTemp = cli.ultima.temperature|number_format(0, '', '') %}
{% if valorTemp is not null and valorTemp is not empty %}
{% if valorTemp < 1 and valorTemp > -1 %}
{% set valorTemp = 0 %}
{% endif %}
{% set valorTemp = valorTemp ~ "º" %}
{% else %}
{% set valorTemp = "-" %}
{% endif %}
{% if cli.posMax == -1 %}
{% set maxClass = "max emph" %}
{% endif %}
<div class="column {{ maxClass }}">{{ valorTemp }}</div>
</div>
<div class="ui equal width center aligned grid scale">
<div class="column">
<svg class="noWidth" width="39" height="39" xmlns="http://www.w3.org/2000/svg"
>
<g fill="#ddd">
<g stroke="null"
transform="matrix(0.7916406393051147,0,0,0.7916406393051147,-0.20773422856450452,6.4587236917304836)"
id="svg_9">
<svg stroke="null" viewBox="0 0 100 100" height="100px"
width="100px" y="-35.7368" x="-25.7368" id="svg_8"
xmlns="http://www.w3.org/2000/svg">
<g stroke="null" id="svg_3">
<g stroke="null" id="svg_4">
<path stroke="null" id="svg_5"
d="m38.688,41.859l-2.828,-2.828c-0.781,-0.78 -2.047,-0.78 -2.828,0c-0.781,0.781 -0.781,2.047 0,2.828l2.828,2.828c0.781,0.781 2.047,0.781 2.828,0c0.781,-0.781 0.781,-2.046 0,-2.828zm33.309,12.141l-3.999,0c-1.104,0 -1.999,0.896 -1.999,2s0.895,2 1.999,2l3.999,0c1.105,0 2,-0.896 2,-2s-0.894,-2 -2,-2zm-39.994,0l-4,0c-1.104,0 -2,0.896 -2,2s0.896,2 2,2l4,0c1.104,0 2,-0.896 2,-2s-0.897,-2 -2,-2zm27.996,9.999l-19.998,0c-1.104,0 -1.999,0.896 -1.999,2s0.896,1.999 1.999,1.999l19.998,0c1.104,0 2,-0.895 2,-1.999s-0.895,-2 -2,-2zm6.97,-24.968c-0.78,-0.78 -2.048,-0.78 -2.828,0l-2.828,2.828c-0.78,0.781 -0.78,2.047 0,2.828c0.781,0.781 2.048,0.781 2.828,0l2.828,-2.828c0.78,-0.781 0.78,-2.047 0,-2.828zm-16.968,0.971c1.104,0 1.999,-0.896 1.999,-2l0,-3.999c0,-1.104 -0.896,-2 -1.999,-2c-1.105,0 -2,0.896 -2,2l0,3.999c0,1.104 0.895,2 2,2zm0,4c-6.627,0 -11.999,5.371 -11.999,11.998c0,1.404 0.254,2.747 0.697,3.999l4.381,0c-0.683,-1.177 -1.079,-2.54 -1.079,-3.999c0,-4.418 3.582,-7.999 8,-7.999c4.417,0 7.998,3.581 7.998,7.999c0,1.459 -0.396,2.822 -1.078,3.999l4.381,0c0.443,-1.252 0.697,-2.595 0.697,-3.999c0,-6.627 -5.372,-11.998 -11.998,-11.998zm0,16.247c0.552,0 0.999,-0.447 0.999,-1l0,-3.827l2.536,2.535c0.39,0.391 1.023,0.391 1.414,0c0.39,-0.391 0.39,-1.023 0,-1.414l-4.242,-4.242c-0.391,-0.391 -1.024,-0.391 -1.414,0l-4.242,4.242c-0.391,0.391 -0.391,1.023 0,1.414s1.023,0.391 1.414,0l2.535,-2.535l0,3.827c0,0.553 0.447,1 1,1z"
clip-rule="evenodd" fill-rule="evenodd"/>
</g>
</g>
</svg>
</g>
</g>
</svg>
</div>
{% set icono_clima = "" %}
{% for horario in cli.horario|default([]) %}
<div class="column skyicon">
{% if icono_clima != horario.clima.conditionCode %}
{% set icono_clima = horario.clima.conditionCode %}
{# <canvas class="{{ icono_clima }}" width="35" height="35">
</canvas> #}
{% if horario.clima.conditionCode is defined and horario.clima.conditionCode is not empty %}
<i class="ui huge grey icon">
{# <canvas class="{{ cli.conditionCode }}" width="35" height="35">
</canvas> #}
{% include 'FrontendBundle:Climacon:' ~ horario.clima.conditionCode ~ '.html.twig' ignore missing %}
</i>
{% endif %}
{% endif %}
</div>
{% endfor %}
<div class="column">
<svg class="noWidth" width="39" height="39" xmlns="http://www.w3.org/2000/svg"
>
<g fill="#ddd">
<g stroke="null" id="svg_6">
<path stroke="null" id="svg_7"
d="m36.67492,25.88526l-3.14573,0c-0.86822,0 -1.57208,-0.70464 -1.57208,-1.57286s0.70386,-1.57286 1.57208,-1.57286l3.14573,0c0.86822,0 1.57208,0.70464 1.57208,1.57286s-0.70307,1.57286 -1.57208,1.57286zm-6.17821,-10.46898c-0.6142,0.6142 -1.61061,0.6142 -2.22403,0c-0.6142,-0.6142 -0.6142,-1.60983 0,-2.22403l2.22403,-2.22403c0.61342,-0.61342 1.60983,-0.61342 2.22324,0c0.6142,0.6142 0.6142,1.60983 0,2.22403l-2.22324,2.22403zm-2.23347,12.04105l-3.44536,0c0.53635,-0.92563 0.84777,-1.99754 0.84777,-3.14494c0,-3.47445 -2.81621,-6.29067 -6.28988,-6.29067c-3.47445,0 -6.29145,2.81621 -6.29145,6.29067c0,1.1474 0.31221,2.21931 0.84935,3.14494l-3.44614,0c-0.34839,-0.98461 -0.54814,-2.04079 -0.54814,-3.14494c0,-5.21168 4.22471,-9.43561 9.43639,-9.43561c5.2109,0 9.43561,4.22392 9.43561,9.43561c0,1.10415 -0.19975,2.16033 -0.54814,3.14494zm-8.88746,-15.72627c-0.86901,0 -1.57286,-0.70464 -1.57286,-1.57286l0,-3.14494c0,-0.86822 0.70386,-1.57286 1.57286,-1.57286c0.86822,0 1.57286,0.70464 1.57286,1.57286l0,3.14494c0,0.86822 -0.70543,1.57286 -1.57286,1.57286zm-11.12093,3.68522l-2.22403,-2.22403c-0.6142,-0.6142 -0.6142,-1.60983 0,-2.22403c0.6142,-0.61342 1.60983,-0.61342 2.22403,0l2.22403,2.22403c0.6142,0.6142 0.6142,1.60983 0,2.22403s-1.60904,0.6142 -2.22403,0zm-1.4604,8.89611c0,0.86822 -0.70464,1.57286 -1.57286,1.57286l-3.14573,0c-0.86822,0 -1.57286,-0.70464 -1.57286,-1.57286s0.70464,-1.57286 1.57286,-1.57286l3.14573,0c0.86822,0 1.57286,0.70464 1.57286,1.57286zm12.58133,-3.14573c0.43411,0 0.78643,0.35232 0.78643,0.78643l0,3.01046l1.9936,-1.9936c0.30749,-0.30749 0.80452,-0.30749 1.11201,0s0.30749,0.80452 0,1.11201l-3.33604,3.33604c-0.30749,0.30749 -0.80452,0.30749 -1.11201,0l-3.33604,-3.33604c-0.30749,-0.30749 -0.30749,-0.80452 0,-1.11201s0.80452,-0.30749 1.11201,0l1.9936,1.9936l0,-3.01046c0,-0.43411 0.35153,-0.78643 0.78643,-0.78643zm-7.86353,9.43639l15.72627,0c0.86822,0 1.57286,0.70464 1.57286,1.57286s-0.70464,1.57208 -1.57286,1.57208l-15.72627,0c-0.86822,0 -1.57286,-0.70386 -1.57286,-1.57208s0.70386,-1.57286 1.57286,-1.57286z"
clip-rule="evenodd" fill-rule="evenodd"/>
</g>
</g>
</svg>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% endif %}