Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6311 | Rev 6446 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6311 Rev 6413
Línea 569... Línea 569...
569
        
569
        
570
        $("#extended-box").modal('hide');
570
        $("#extended-box").modal('hide');
571
        return false;
571
        return false;
Línea 572... Línea -...
572
    });
-
 
573
 
-
 
574
 
-
 
575
	var validatorFoundationYear = $('#form-foundation-year').validate({
-
 
576
        debug: true,
-
 
577
        onclick: false,
-
 
578
        onkeyup: false,
-
 
579
        onfocusout: false,
-
 
580
        ignore: [],
-
 
581
        rules: {
-
 
582
            'foundation_year': {
-
 
583
                required: true,
-
 
584
                maxlength: 4,
-
 
585
                digits: true,
-
 
586
            },
-
 
587
        },
-
 
588
 
-
 
589
        submitHandler: function(form)
-
 
590
        {
-
 
591
            NProgress.start();
-
 
592
            $.ajax({
-
 
593
                'dataType'  : 'json',
-
 
594
                'accept'    : 'application/json',
-
 
595
                'method'    : 'post',
-
 
596
                'url'       :  $('#form-foundation-year').attr('action'),
-
 
597
                'data'      :  $('#form-foundation-year').serialize()
-
 
598
            }).done(function(response) {
-
 
599
                if(response['success']) {
-
 
600
 
-
 
601
                    $('#overview-foundation-year').html(response['data']['foundation_year']);
-
 
602
                    $("#foundation-year-box").modal('hide');
-
 
603
                } else {
-
 
604
                    validatorFoundationYear.resetForm();
-
 
605
                    if(jQuery.type(response['data']) == 'string') {
-
 
606
                        $.fn.showError(response['data']);
-
 
607
                    } else  {
-
 
608
                        $.each(response['data'], function( fieldname, errors ) {
-
 
609
                            $.fn.showFormErrorValidator('#form-foundation-year #' + fieldname, errors);
-
 
610
                        });
-
 
611
                    }
-
 
612
                }
-
 
613
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
614
                $.fn.showError(textStatus);
-
 
615
            }).always(function() {
-
 
616
                NProgress.done();
-
 
617
            });
-
 
618
            return false;
-
 
619
        },
-
 
620
        invalidHandler: function(form, validator) {
-
 
621
        
-
 
622
        }
-
 
623
    });
-
 
624
 
-
 
625
 
-
 
626
    $('.btn-foundation-year-edit').on("click", function(e){
-
 
627
        e.preventDefault();
-
 
628
 
-
 
629
        NProgress.start();
-
 
630
        $.ajax({
-
 
631
            'dataType'  : 'json',
-
 
632
            'accept'    : 'application/json',
-
 
633
            'method'    : 'get',
-
 
634
            'url'       : '$routeFoundationYear',
-
 
635
        }).done(function(response) {
-
 
636
           if(response['success']) {
-
 
637
				$('#form-foundation-year #foundation_year').val(response['data']['foundation_year'])
-
 
638
           
-
 
639
                validatorFoundationYear.resetForm();
-
 
640
 
-
 
641
                $("#foundation-year-box").modal('show');
-
 
642
            } else {
-
 
643
                $.fn.showError(response['data']);
-
 
644
            }
-
 
645
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
646
            $.fn.showError(textStatus);
-
 
647
        }).always(function() {
-
 
648
            NProgress.done();
-
 
649
        });
-
 
650
        return false;
-
 
651
 
-
 
652
    });
-
 
653
    
-
 
654
    $('.btn-fondation-year-close').on("click", function(e){
-
 
655
        e.preventDefault();
-
 
656
        
-
 
657
        $("#foundation-year-box").modal('hide');
-
 
658
        return false;
-
 
659
    });
572
    });
660
 
573
 
661
	var validatorCompanySize = $('#form-company-size').validate({
574
	var validatorCompanySize = $('#form-company-size').validate({
662
        debug: true,
575
        debug: true,
663
        onclick: false,
576
        onclick: false,
Línea 1084... Línea 997...
1084
    CKEDITOR.replace('description');
997
    CKEDITOR.replace('description');
Línea 1085... Línea 998...
1085
 
998
 
Línea 1086... Línea 999...
1086
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
999
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
1087
 
-
 
1088
    $('#form-location #is_main').bootstrapToggle({'on' : 'LABEL_MAIN_LOCATION',  'off' : 'LABEL_SECONDARY_LOCATION', 'width' : '160px', 'height' : '40px'});
-
 
1089
 
-
 
1090
    $('#form-foundation-year #foundation_year').datetimepicker({
-
 
1091
        viewMode: 'years',
-
 
Línea 1092... Línea 1000...
1092
        format: 'YYYY'
1000
 
Línea 1093... Línea 1001...
1093
    });
1001
    $('#form-location #is_main').bootstrapToggle({'on' : 'LABEL_MAIN_LOCATION',  'off' : 'LABEL_SECONDARY_LOCATION', 'width' : '160px', 'height' : '40px'});