<commit_before>{% extends 'base.html.twig' %}

{% block body %}
   <div class="container">
       {{ include('KupelikeBundle:Kupela:_facebook.html.twig') }}
        <div class="row single-sagardotegi">
            <div class="col-xs-6">
                <h1 class="card-title text-uppercase">{{ sagardotegi.nombre }}</h1>
                    <p class="single-description" id="descripcion">{{ sagardotegi.descripcion }}</p>
                     <p class="single-description" id="descripcion">{{ sagardotegi.horario }}</p>
                    <a href="{{ path("sagardotegi_mapa", {idSagardotegi:sagardotegi.id}) }}"><button type="button" class="btn btn-default">{{ 'paginas.sidrerias.llegar' | trans }}</button></a>
                    <button id="contactoSidreria" type="button" class="btn btn-default">{{ 'paginas.sidrerias.contacto' | trans }}</button>
                    <div id="mostrarcontacto">
                        <p class="single-description">{{sagardotegi.direccion}}</p>
                        <a href="mailto:{{sagardotegi.email}}"><p class="single-description">{{sagardotegi.email}}</p></a>
                        <a href="tel:{{sagardotegi.telefono}}"><p class="single-description">{{sagardotegi.telefono}}</p></a> 
                    </div>
            </div>
            <div class="col-xs-6">
                <div class="card-single-direction text-uppercase text-center"><h4>{{ sagardotegi.pueblo }}</h4></div>
                <img class="single-img img-responsive img-rounded" src="{{asset(sagardotegi.foto)}}"></img>
            </div>
        </div>
    </div>
    <script>
        var pusher = new Pusher('a37218af0d3c7dcfceae', {
            encrypted: true
        });
        var channel = pusher.subscribe('my-channel');
        channel.bind('my-event', function(data) {
            document.getElementById(data.id).innerHTML = data.message + "<i class='fa fa-heart fa-1x' aria-hidden='true'></i>";
        });
    </script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
    
<div class="container-fluid">
        
    <div class="row p-x-1 kupela-list">
        <div class="col-xs-12 col-md-8 col-md-offset-2 col-xl-6 col-xl-offset-3">
    {% for i, kupela in kupelas %}
        
    <!-- Stats window -->
       
        <div class="statsWrapper">
            <div id="statsWindow" class="row stats{{kupela.id}} stats">
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">
                            <a class="pull-right closeStats"><i class="fa fa-times fa-2x" aria-hidden="true"></i></a>
                        </div>
                    </div>
                
                    <div class="row">
                        <div class="col-xs-12">
                            <h1 class="access-title text-center">{{kupela.nombre}}</h1>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6">
                            <div id="chartContainer-{{kupela.id}}" style="height: 100%; max-width: 100%"></div>
                        </div>
                        <div class="col-xs-6">
                            <div id="chartContainer2-{{kupela.id}}" style="height: 100%; max-width: 100%"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
    <!-- FIN Stats window -->
    
        <div class="row single-kupela">
            <div class="col-xs-4 vote-wrapper">
                <div class="row text-center">
                    <div class="col-xs-12 p-x-0">
                    <img src="{{asset(kupela.foto)}}" alt="kupela" class="single-kupela-img img-responsive"></img>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6">
                        <h3 id="{{kupela.id}}" class="vote-count">{{kupela.numVotos}}<i class="fa fa-heart fa-1x" aria-hidden="true"></i></h3>
                    </div>
                     <div class="col-xs-6 p-x-0">   
                        <button class="vote-button pull-right">
                            <a class="btn-facebook" numero="{{kupela.id}}">
                                <img class="vote-logo" src="/img/logo_reverse.jpg"></img>
                            </a>
                        </button>
                    </div>
                </div>
            </div>
            <div class="col-xs-8">
                <div class="caption">
                    <h3 class="card-title text-uppercase">{{kupela.nombre}}</h3>
                    <p class="single-description">{{kupela.descripcion}}</p>
                    <button class="btn btn-primary btn-aviso pull-right" numero="{{kupela.id}}">{{ 'boton.aviso' | trans }}</button>
                    <button class="btn btn-primary btn-stats pull-right" id="stats{{kupela.id}}">{{ 'boton.stats' | trans }}</button>
                </div>
            </div>
        </div>
      
    {% endfor %}
        </div>
        
    </div>
    
     <script src={{asset("js/estadisticas.min.js")}}></script>
     <script type="text/javascript">
      
      window.onload = function () {
         var kupelasid = [];
         var kupelaslikes = [];
         //var hombres2 = 0;
         var kupelah = [];
         var kupelam = [];
         var ezh = 0;
         var ezm = 0;
         
        {% for kupela in kupelas %}
        {% set breakLooph = false %}
            {% for hombre in hombres if breakLooph == false %}
                {% if kupela.id == hombre.id %}
                    //hombres2++;
                    kupelah.push({{hombre.hombres}});
                    ezh = 1;
                    {% set breakLooph = true %}
                {% else %}
              	    ezh = 0;
              	{% endif %}
          	{% endfor %}
          	
        {% set breakLoopm = false %}
          	{% for mujer in mujeres if breakLoopm == false %}
                {% if kupela.id == mujer.id %}
                    //hombres2++;
                    kupelam.push({{mujer.mujeres}});
                    ezm = 1;
                    {% set breakLoopm = true %}
                {% else %}
                  	ezm = 0;
              	{% endif %}
          	{% endfor %}
          	
          	if(ezh == 0){ 
          	    kupelah.push(0);
          	} else {
          	    ezh = 0;
          	}
          	if(ezm == 0){ 
          	    kupelam.push(0);
          	} else {
          	    ezm = 0;
          	}
 
          	kupelasid.push({{kupela.id}});
          	kupelaslikes.push({{kupela.numVotos}});
        //hombres2 = 0;
        {% endfor %}

        var chart = [];
        var chart2 = [];
        //var anonimos;
        for (i = 0; i < kupelasid.length; i++) {
        anonimos = kupelaslikes[i] - kupelam[i] - kupelah[i];
        chart[i] = new CanvasJS.Chart("chartContainer-"+kupelasid[i], {
          		theme: "theme2",//theme1
          		//width: 350,
          		title:{
          			text: "Likes a la kupela por GENERO"              
          		},
          		animationEnabled: false,   // change to true
          		data: [              
          		{
          			// Change type to "bar", "area", "spline", "pie",etc.
          			type: "bar",
          			dataPoints: [
          			    
          				{ y: kupelam[i], label: "Mujeres" },
          				{ y: kupelah[i], label: "Hombres" },
          				{ y: anonimos, label: "Anónimos" }
          				
          			]
          		}
          		]
          	});
          	chart[i].render();
          	
        //anonimos = kupelaslikes[i] - kupelam[i] - kupelah[i];
        chart2[i] = new CanvasJS.Chart("chartContainer2-"+kupelasid[i], {
          		theme: "theme2",//theme1
          		//width: 350,
          		title:{
          			text: "Likes a la kupela por GENERO"              
          		},
          		animationEnabled: false,   // change to true
          		data: [              
          		{
          			// Change type to "bar", "area", "spline", "pie",etc.
          			type: "column",
          			dataPoints: [

          			]
          		}
          		]
          	});
          	{% for fecha in fechas %}
                if (kupelasid[i] == {{fecha.id}}){
                    chart2[i].options.data[0].dataPoints.push({ label: "{{fecha.fecha}}",  y: {{fecha.NumVotos}} });
                }
            {% endfor %}
          	chart2[i].render();
        }
        
      }
      </script>
    
{% endblock %} <commit_msg>estadisticas mejorando3<commit_after>{% extends 'base.html.twig' %}

{% block body %}
   <div class="container">
       {{ include('KupelikeBundle:Kupela:_facebook.html.twig') }}
        <div class="row single-sagardotegi">
            <div class="col-xs-6">
                <h1 class="card-title text-uppercase">{{ sagardotegi.nombre }}</h1>
                    <p class="single-description" id="descripcion">{{ sagardotegi.descripcion }}</p>
                     <p class="single-description" id="descripcion">{{ sagardotegi.horario }}</p>
                    <a href="{{ path("sagardotegi_mapa", {idSagardotegi:sagardotegi.id}) }}"><button type="button" class="btn btn-default">{{ 'paginas.sidrerias.llegar' | trans }}</button></a>
                    <button id="contactoSidreria" type="button" class="btn btn-default">{{ 'paginas.sidrerias.contacto' | trans }}</button>
                    <div id="mostrarcontacto">
                        <p class="single-description">{{sagardotegi.direccion}}</p>
                        <a href="mailto:{{sagardotegi.email}}"><p class="single-description">{{sagardotegi.email}}</p></a>
                        <a href="tel:{{sagardotegi.telefono}}"><p class="single-description">{{sagardotegi.telefono}}</p></a> 
                    </div>
            </div>
            <div class="col-xs-6">
                <div class="card-single-direction text-uppercase text-center"><h4>{{ sagardotegi.pueblo }}</h4></div>
                <img class="single-img img-responsive img-rounded" src="{{asset(sagardotegi.foto)}}"></img>
            </div>
        </div>
    </div>
    <script>
        var pusher = new Pusher('a37218af0d3c7dcfceae', {
            encrypted: true
        });
        var channel = pusher.subscribe('my-channel');
        channel.bind('my-event', function(data) {
            document.getElementById(data.id).innerHTML = data.message + "<i class='fa fa-heart fa-1x' aria-hidden='true'></i>";
        });
    </script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
    
<div class="container-fluid">
        
    <div class="row p-x-1 kupela-list">
        <div class="col-xs-12 col-md-8 col-md-offset-2 col-xl-6 col-xl-offset-3">
    {% for i, kupela in kupelas %}
        
    <!-- Stats window -->
       
        <div class="statsWrapper">
            <div id="statsWindow" class="row stats{{kupela.id}} stats">
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">
                            <a class="pull-right closeStats"><i class="fa fa-times fa-2x" aria-hidden="true"></i></a>
                        </div>
                    </div>
                
                    <div class="row">
                        <div class="col-xs-12">
                            <h1 class="access-title text-center">{{kupela.nombre}}</h1>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6">
                            <div id="chartContainer-{{kupela.id}}" style="height: 100%; max-width: 100%"></div>
                        </div>
                        <div class="col-xs-6">
                            <div id="chartContainer2-{{kupela.id}}" style="height: 100%; max-width: 100%"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
    <!-- FIN Stats window -->
    
        <div class="row single-kupela">
            <div class="col-xs-4 vote-wrapper">
                <div class="row text-center">
                    <div class="col-xs-12 p-x-0">
                    <img src="{{asset(kupela.foto)}}" alt="kupela" class="single-kupela-img img-responsive"></img>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6">
                        <h3 id="{{kupela.id}}" class="vote-count">{{kupela.numVotos}}<i class="fa fa-heart fa-1x" aria-hidden="true"></i></h3>
                    </div>
                     <div class="col-xs-6 p-x-0">   
                        <button class="vote-button pull-right">
                            <a class="btn-facebook" numero="{{kupela.id}}">
                                <img class="vote-logo" src="/img/logo_reverse.jpg"></img>
                            </a>
                        </button>
                    </div>
                </div>
            </div>
            <div class="col-xs-8">
                <div class="caption">
                    <h3 class="card-title text-uppercase">{{kupela.nombre}}</h3>
                    <p class="single-description">{{kupela.descripcion}}</p>
                    <button class="btn btn-primary btn-aviso pull-right" numero="{{kupela.id}}">{{ 'boton.aviso' | trans }}</button>
                    <button class="btn btn-primary btn-stats pull-right" id="stats{{kupela.id}}">{{ 'boton.stats' | trans }}</button>
                </div>
            </div>
        </div>
      
    {% endfor %}
        </div>
        
    </div>
    
     <script src={{asset("js/estadisticas.min.js")}}></script>
     <script type="text/javascript">
      
      window.onload = function () {
         var kupelasid = [];
         var kupelaslikes = [];
         //var hombres2 = 0;
         var kupelah = [];
         var kupelam = [];
         var ezh = 0;
         var ezm = 0;
         
        {% for kupela in kupelas %}
        {% set breakLooph = false %}
            {% for hombre in hombres if breakLooph == false %}
                {% if kupela.id == hombre.id %}
                    //hombres2++;
                    kupelah.push({{hombre.hombres}});
                    ezh = 1;
                    {% set breakLooph = true %}
                {% else %}
              	    ezh = 0;
              	{% endif %}
          	{% endfor %}
          	
        {% set breakLoopm = false %}
          	{% for mujer in mujeres if breakLoopm == false %}
                {% if kupela.id == mujer.id %}
                    //hombres2++;
                    kupelam.push({{mujer.mujeres}});
                    ezm = 1;
                    {% set breakLoopm = true %}
                {% else %}
                  	ezm = 0;
              	{% endif %}
          	{% endfor %}
          	
          	if(ezh == 0){ 
          	    kupelah.push(0);
          	} else {
          	    ezh = 0;
          	}
          	if(ezm == 0){ 
          	    kupelam.push(0);
          	} else {
          	    ezm = 0;
          	}
 
          	kupelasid.push({{kupela.id}});
          	kupelaslikes.push({{kupela.numVotos}});
        //hombres2 = 0;
        {% endfor %}

        var chart = [];
        var chart2 = [];
        //var anonimos;
        for (i = 0; i < kupelasid.length; i++) {
        anonimos = kupelaslikes[i] - kupelam[i] - kupelah[i];
        chart[i] = new CanvasJS.Chart("chartContainer-"+kupelasid[i], {
          		theme: "theme2",//theme1
          		//width: 350,
          		title:{
          			text: "Likes a la kupela por GENERO"              
          		},
          		animationEnabled: false,   // change to true
          		data: [              
          		{
          			// Change type to "bar", "area", "spline", "pie",etc.
          			type: "bar",
          			dataPoints: [
          			    
          				{ y: kupelam[i], label: "Mujeres" },
          				{ y: kupelah[i], label: "Hombres" },
          				{ y: anonimos, label: "Anónimos" }
          				
          			]
          		}
          		]
          	});
          	chart[i].render();
          	
        //anonimos = kupelaslikes[i] - kupelam[i] - kupelah[i];
        chart2[i] = new CanvasJS.Chart("chartContainer2-"+kupelasid[i], {
          		theme: "theme2",//theme1
          		//width: 350,
          		title:{
          			text: "Likes a la kupela por FECHA"              
          		},
          		animationEnabled: false,   // change to true
          		data: [              
          		{
          			// Change type to "bar", "area", "spline", "pie",etc.
          			type: "column",
          			dataPoints: [

          			]
          		}
          		]
          	});
          	{% for fecha in fechas %}
                if (kupelasid[i] == {{fecha.id}}){
                    chart2[i].options.data[0].dataPoints.push({ label: "{{fecha.fecha}}",  y: {{fecha.NumVotos}} });
                }
            {% endfor %}
          	chart2[i].render();
        }
        
      }
      </script>
    
{% endblock %} 
{'fraction_non_alphanumeric': 0.16302454918263018, 'fraction_numerical': 0.01207797314757598, 'mean_word_length': 1.2928902627511591, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 0, '>': 261, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '11750', 'n_tokens_mistral': 5953, 'n_tokens_neox': 5565, 'n_words': 933}