<commit_before><div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header bg-primary text-white">
            <button type="button" class="close text-white" data-dismiss="modal" aria-hidden="true">
                    <i class="fa fa-times text-white"></i>
            </button>
            <h3>Añadir Deporte</h3>
        </div> <!-- /modal-header -->
        <div class="modal-body">	
            <div class="row">
                <div class="col-xs-6 col-xs-offset-3 text-center">
                    <form action="" method="POST">
                        <div class="form-group">
                            <div class="row text-left">
                                {{ form_label(form.sports) }}
                            </div>
                            {{ form_widget(form.sports,{ 'attr': {'class': 'form-control select-sport'} }) }}             
                        </div>
                        <div class="form-group">
                            <div class="row text-left">
                                <label>Nivel</label>
                            </div>
                            {% for i in 0..4 %}            
                                <a href="#" class="btn btn-danger action-level" data-id="{{i}}"> <i class="fa fa-star"></i> </a>
                            {% endfor %}
                        </div>
                        <input class="btn btn-primary btn-large" type="submit" value="Guardar"/>
                        <input class="hiddenId" type="hidden"/>
                    </form>
                </div>
            </div>
        </div> <!-- /modal-body -->
    </div> <!-- /modal-content -->
</div> <!-- /modal-dialog -->
<script>
    $(document).ready(function() {
        $(document).on("click", '.action-level', function(event) {
            event.preventDefault();
            var id=$(this).data('id');
            var button=element.find('.action-subscribe');
            $(this).find('i').addClass('fa-star-half-full');
            $(this).find('i').removeClass('fa-star');
        });            
        
        $('.select-sport').on('change', function() {
                $.ajax({
                    method: "GET",
                    url: "{{path('intranet_ajax_find_sport')}}",
                    dataType: "json",
                    data: {
                        sport: this.value
                    },
                    success: function(data) {
                        $('.hiddenId').val(data.id);
                    }
                });
         });
         
         $(document).on("click", '.btn-primary btn-large', function(event) {
            event.preventDefault();            
            $.ajax({
                method: "GET",
                url: "{{path('intranet_ajax_subscribe_sport')}}",
                dataType: "json",
                data: {
                    sport: $('.hiddenId').val(),
                    level: 1
                },
                success: function(data) {
                   $(this).close();  
                }
            });
        });   
    });        
</script><commit_msg>Modificada la ventana modal para añadir los Deportes<commit_after><div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header bg-primary text-white">
            <button type="button" class="close text-white" data-dismiss="modal" aria-hidden="true">
                    <i class="fa fa-times text-white"></i>
            </button>
            <h3>Añadir Deporte</h3>
        </div> <!-- /modal-header -->
        <div class="modal-body">	
            <div class="row">
                <div class="col-xs-6 col-xs-offset-3 text-center">
                    <form action="{{path('intranet_ajax_subscribe_sport')}}" method="POST">
                        <div class="form-group">
                            <div class="row text-left">
                                {{ form_label(form.sports) }}
                            </div>
                            {{ form_widget(form.sports,{ 'attr': {'class': 'form-control select-sport'} }) }}             
                        </div>
                        <div class="form-group">
                            <div class="row text-left">
                                <label>Nivel</label>
                            </div>
                            {% for i in 0..4 %}            
                                <a href="#" class="btn btn-danger action-level" data-id="{{i}}"> <i class="fa fa-star"></i> </a>
                            {% endfor %}
                        </div>
                        <input class="btn btn-primary" type="submit" value="Guardar"/>
                        {{ form_widget(form.idSport,{ 'attr': {'class': 'sport-id'} }) }}
                    </form>
                </div>
            </div>
        </div> <!-- /modal-body -->
    </div> <!-- /modal-content -->
</div> <!-- /modal-dialog -->
<script>
    $(document).ready(function() {
        $(document).on("click", '.btn-danger action-level', function(event) {
            event.preventDefault();
            
        });            
        
        $('.select-sport').on('change', function() {
                $.ajax({
                    method: "GET",
                    url: "{{path('intranet_ajax_find_sport')}}",
                    dataType: "json",
                    data: {
                        sport: this.value
                    },
                    success: function(data) {
                        $('.sport-id').val(data.id);
                    }
                });
         });
         
         $(document).on("click", '.btn-primary', function(event) {
                event.preventDefault();            
                $.ajax({
                    method: "GET",
                    url: "{{path('intranet_ajax_subscribe_sport')}}",
                    dataType: "json",
                    data: {
                        sport: $('.sport-id').val(),
                        level: 1
                    },
                    success: function(data) {
                       $(this).close();  
                    }
                });
        });   
    });        
</script>
{'fraction_non_alphanumeric': 0.16056518946692358, 'fraction_numerical': 0.00224791265253693, 'mean_word_length': 1.0197795071335927, 'pattern_counts': {'":': 0, '<': 86, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3314834', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1528, 'n_words': 272}