<commit_before>{% extends "PicweekMainBundle::layout.html.twig" %}


{% block stylesheets %}
    {{ parent() }}
    <style type="text/css">
        #gmap{
            background: #B2B2B2;
        }

        #search{
            width: 600px;
            height: 20px;
            padding: 10px;
            margin: 10px 100px;
            position: absolute;
            top: 0px;
            background: white;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
        }

        #search #location{
            display : inline;
        }

        #search #distance{
            float:right;
            width: 75px;
            background: white;
        }

        #search #distance .name{
            text-align: center;
            border-top: solid 1px;
            border-left: solid 1px;
            border-right: solid 1px;
            border-color:transparent;
            -webkit-border-top-left-radius: 5px;
            -webkit-border-top-right-radius: 5px;
            -moz-border-radius-topleft: 5px;
            -moz-border-radius-topright: 5px;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
            padding-bottom:2px;
        }

        #search #distance .select .title{
            font-weight: bold;
        }

        #search #distance .select{
            background: white;
            position : absolute;
            border : solid 1px;
            border-color:transparent;
            border-top : none;
            width: 150px;
            margin-left:-77px;
            -webkit-border-radius: 5px;
            -webkit-border-top-right-radius: 0;
            -moz-border-radius: 5px;
            -moz-border-radius-topright: 0;
            border-radius: 5px;
            border-top-right-radius: 0;
            display: none;
        }

        #search #distance div{
            margin-left:10px;
        }

        #search #help-search #actual{
            border: solid 1px red;
            display: none;
            position : relative;
            background: white;
            width: 100%;
        }

        #search #distance .border-middle{
            margin:0px;
            border-top:solid 1px transparent;
            border-color:transparent;
            width: 87px;
            height:3px;
            -webkit-border-top-left-radius: 5px;
            -moz-border-radius-topleft: 5px;
            border-top-left-radius: 5px;
        }


    </style>
{% endblock %}

{% block headJavascripts %}
    {{ parent() }}
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" >
    $(document).ready(function(){
        initInterfacesActions();
    });

    function initInterfacesActions()
    {
        $("#search input:button[name=locate]").click(function(){
            if(navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function(position){
                    var location = new google.maps.LatLng(
                        position.coords.latitude, position.coords.longitude, false
                    );
                    var geocoder = new google.maps.Geocoder();
                    geocoder.geocode({'location': location}, function(result, status){
                        result = result[1];
                        var address = result.formatted_address;
                        $("#search input[name=location]").val(address);
                        getPlaces();
                    });
                });
            }
        });

        $('#search #distance').hover(
            function(){

                $(this).children(".select").stop(true).fadeIn(500);
                $(this).children("div").css('border-color', '#CCCBD2');
                $(this).children(".select").children('div').css('border-color', '#CCCBD2');
            },
            function(){

                $(this).children("div").css('border-color', 'transparent');
                $(this).children(".select").children('div').css('border-color', 'transparent');
                $(this).children(".select").stop(true).fadeOut(200);
            }
        );

        $('#search #distance input[type=radio]').change(function(){
            var radius = $(this).val();
            $('#search #distance .name').html(radius+' km');
            $('#search').data('radius', radius);
            getPlaces();
        });


        $( "#search #location input:text" ).autocomplete({
            source: function(request, response){
                var geocoder = new google.maps.Geocoder();
                geocoder.geocode({'address' : request.term}, function(results, status){
                    if(status !== google.maps.GeocoderStatus.OK) {
                        response([]);
                        return;
                    }

                    response($.map(results, function(item) {
                        return {
                          label: item.formatted_address,
                          value: item.formatted_address,
                          geocode: item,
                        };
                      }
                    ));<commit_msg>correction search form (JS, CSS)<commit_after>{% extends "PicweekMainBundle::layout.html.twig" %}


{% block stylesheets %}
    {{ parent() }}
    <style type="text/css">
        #gmap{
            background: #B2B2B2;
        }

        #search{
            width: 600px;
            height: 20px;
            padding: 10px;
            margin: 10px 100px;
            position: absolute;
            top: 0px;
            background: white;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
        }

        #search input[type=button]{
            padding: 2px;
        }


        #search #location{
            display : inline;
        }

        #search #distance{
            float:right;
            width: 75px;
            background: white;
        }

        #search #distance .name{
            text-align: center;
            border-top: solid 1px;
            border-left: solid 1px;
            border-right: solid 1px;
            border-color:transparent;
            -webkit-border-top-left-radius: 5px;
            -webkit-border-top-right-radius: 5px;
            -moz-border-radius-topleft: 5px;
            -moz-border-radius-topright: 5px;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
            padding-bottom:2px;
        }

        #search #distance .select .title{
            font-weight: bold;
        }

        #search #distance .select{
            background: white;
            position : absolute;
            border : solid 1px;
            border-color:transparent;
            border-top : none;
            width: 150px;
            margin-left:-77px;
            -webkit-border-radius: 5px;
            -webkit-border-top-right-radius: 0;
            -moz-border-radius: 5px;
            -moz-border-radius-topright: 0;
            border-radius: 5px;
            border-top-right-radius: 0;
            display: none;
        }

        #search #distance div{
            margin-left:10px;
        }

        #search #help-search #actual{
            border: solid 1px red;
            display: none;
            position : relative;
            background: white;
            width: 100%;
        }

        #search #distance .border-middle{
            margin:0px;
            border-top:solid 1px transparent;
            border-color:transparent;
            width: 87px;
            height:3px;
            -webkit-border-top-left-radius: 5px;
            -moz-border-radius-topleft: 5px;
            border-top-left-radius: 5px;
        }


    </style>
{% endblock %}

{% block headJavascripts %}
    {{ parent() }}
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" >
    $(document).ready(function(){
        initInterfacesActions();
    });

    function initInterfacesActions()
    {
        $("#search input:button[name=locate]").click(function(){
            if(navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(function(position){
                    var location = new google.maps.LatLng(
                        position.coords.latitude, position.coords.longitude, false
                    );
                    var geocoder = new google.maps.Geocoder();
                    geocoder.geocode({'location': location}, function(result, status){
                        result = result[1];
                        var address = result.formatted_address;
                        $("#search input[name=location]").val(address);
                        getPlaces();
                    });
                });
            }
        });

        $('#search #distance').hover(
            function(){

                $(this).children(".select").css('opacity',1).stop(true).fadeIn(500);
                $(this).children("div").css('border-color', '#CCCBD2');
                $(this).children(".select").children('div').css('border-color', '#CCCBD2');
            },
            function(){
                $(this).children("div").css('border-color', 'transparent');
                $(this).children(".select").children('div').css('border-color', 'transparent');
                $(this).children(".select").stop(true).fadeOut(200);
            }
        );

        $('#search #distance input[type=radio]').change(function(){
            var radius = $(this).val();
            $('#search #distance .name').html(radius+' km');
            $('#search').data('radius', radius);
            getPlaces();
        });


        $( "#search #location input:text" ).autocomplete({
            source: function(request, response){
                var geocoder = new google.maps.Geocoder();
                geocoder.geocode({'address' : request.term}, function(results, status){
                    if(status !== google.maps.GeocoderStatus.OK) {
                        response([]);
                        return;
                    }

                    response($.map(results, function(item) {
                        return {
                          label: item.formatted_address,
                          value: item.formatted_address,
                          geocode: item,
                        };
                      }
                    ));
{'fraction_non_alphanumeric': 0.13156644818086824, 'fraction_numerical': 0.012729172603780755, 'mean_word_length': 1.3775971093044264, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '3633174', 'n_tokens_mistral': 2941, 'n_tokens_neox': 2707, 'n_words': 488}