Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17240 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17240 Rev 17242
Línea 246... Línea 246...
246
                updateCkeditor: function () {
246
                updateCkeditor: function () {
247
                CKEDITOR.instances.description_add.updateElement()
247
                CKEDITOR.instances.description_add.updateElement()
248
                },
248
                },
249
                required: true
249
                required: true
250
            },
250
            },
251
            file: {
251
            image: {
252
                required: true,
252
                required: true,
253
                extension: 'jpg|jpeg|png',
253
                extension: 'jpg|jpeg|png',
254
                accept: 'image/jpg,image/jpeg,image/png'
254
                accept: 'image/jpg,image/jpeg,image/png'
255
            },
255
            },
256
            },
256
            },
Línea 317... Línea 317...
317
                    updateCkeditor: function () {
317
                    updateCkeditor: function () {
318
                    CKEDITOR.instances.description_edit.updateElement()
318
                    CKEDITOR.instances.description_edit.updateElement()
319
                    },
319
                    },
320
                    required: true
320
                    required: true
321
                },
321
                },
322
                file: {
322
                image: {
323
                    required: false,
323
                    required: false,
324
                    extension: 'jpg|jpeg|png',
324
                    extension: 'jpg|jpeg|png',
325
                    accept: 'image/jpg,image/jpeg,image/png'
325
                    accept: 'image/jpg,image/jpeg,image/png'
326
                }
326
                }
327
            },
327
            },
Línea 393... Línea 393...
393
        // Evento de botón de añadir
393
        // Evento de botón de añadir
394
        $('body').on('click', 'button.btn-add', function (e) {
394
        $('body').on('click', 'button.btn-add', function (e) {
395
            e.preventDefault()
395
            e.preventDefault()
Línea 396... Línea 396...
396
 
396
 
397
            $('#form-add #name').val('')
397
            $('#form-add #name').val('')
398
            $('#form-add #file').fileinput('reset')
398
            $('#form-add #image').fileinput('reset')
Línea 399... Línea 399...
399
            $('#form-add #file').val('')
399
            $('#form-add #image').val('')
400
 
400
 
Línea 401... Línea 401...
401
            CKEDITOR.instances.description_add.setData('')
401
            CKEDITOR.instances.description_add.setData('')
Línea 419... Línea 419...
419
            })
419
            })
420
            .done(function (response) {
420
            .done(function (response) {
421
                if (response['success']) {
421
                if (response['success']) {
422
                $('#form-edit').attr('action', url)
422
                $('#form-edit').attr('action', url)
423
                $('#form-edit #name').val(response['data']['name'])
423
                $('#form-edit #name').val(response['data']['name'])
424
                $('#form-edit #file').fileinput('reset')
424
                $('#form-edit #image').fileinput('reset')
425
                $('#form-edit #file').val('')
425
                $('#form-edit #image').val('')
Línea 426... Línea 426...
426
 
426
 
427
                CKEDITOR.instances.description_edit.setData(
427
                CKEDITOR.instances.description_edit.setData(
428
                    response['data']['description']
428
                    response['data']['description']
429
                )
429
                )
Línea 504... Línea 504...
504
            e.preventDefault()
504
            e.preventDefault()
505
            gridTable.api().ajax.reload(null, false)
505
            gridTable.api().ajax.reload(null, false)
506
        })
506
        })
Línea 507... Línea 507...
507
        
507
        
508
        // Configuración del formulario de creación
508
        // Configuración del formulario de creación
509
        $('#form-add #file').fileinput({
509
        $('#form-add #image').fileinput({
510
            theme: 'fa',
510
            theme: 'fa',
511
            language: 'es',
511
            language: 'es',
512
            showUpload: false,
512
            showUpload: false,
513
            dropZoneEnabled: false,
513
            dropZoneEnabled: false,
514
            maxFileCount: 1,
514
            maxFileCount: 1,
515
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
515
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
516
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
516
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
Línea 517... Línea 517...
517
        })
517
        })
518
 
518
 
519
        // Configuración del formulario de edición
519
        // Configuración del formulario de edición
520
        $('#form-edit #file').fileinput({
520
        $('#form-edit #image').fileinput({
521
            theme: 'fa',
521
            theme: 'fa',
522
            language: 'es',
522
            language: 'es',
523
            showUpload: false,
523
            showUpload: false,
Línea 673... Línea 673...
673
                </div>
673
                </div>
Línea 674... Línea 674...
674
                
674
                
675
                <div class="row">
675
                <div class="row">
676
                    <div class="col-12 mt-3">
676
                    <div class="col-12 mt-3">
677
                        <?php
677
                        <?php
678
                        $element = $form->get('file');
678
                        $element = $form->get('image');
679
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
679
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
680
                        $element->setAttributes(['class' => 'form-control']);
680
                        $element->setAttributes(['class' => 'form-control']);
681
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
681
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
682
                        echo $this->formLabel($element);
682
                        echo $this->formLabel($element);
Línea 735... Línea 735...
735
                </div>
735
                </div>
Línea 736... Línea 736...
736
 
736
 
737
                <div class="row">
737
                <div class="row">
738
                    <div class="col-12 mt-3">
738
                    <div class="col-12 mt-3">
739
                            <?php
739
                            <?php
740
                            $element = $form->get('file');
740
                            $element = $form->get('image');
741
                            $element->setOptions(['label' => 'LABEL_IMAGE']);
741
                            $element->setOptions(['label' => 'LABEL_IMAGE']);
742
                            $element->setAttributes(['class' => 'form-control']);
742
                            $element->setAttributes(['class' => 'form-control']);
743
                            $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
743
                            $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
744
                            echo $this->formLabel($element);
744
                            echo $this->formLabel($element);