Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17208 Rev 17209
Línea 472... Línea 472...
472
                method: 'get',
472
                method: 'get',
473
                url: '$routeAdd'
473
                url: '$routeAdd'
474
            })
474
            })
475
                .done(function (response) {
475
                .done(function (response) {
476
                    if (response['success']) {
476
                    if (response['success']) {
477
                        $('#form-add #table-capsules tbody').empty()
477
                        $('#form-add #table-capsules-add tbody').empty()
Línea 478... Línea 478...
478
 
478
 
479
                        $('#form-add #capsule_uuid').children().not(':first').remove()
479
                        $('#form-add #capsule_uuid_add').children().not(':first').remove()
480
                        $.each(response['data']['capsules'], function (index, element) {
480
                        $.each(response['data']['capsules'], function (index, element) {
481
                            $('#form-add #capsule_uuid').append(
481
                            $('#form-add #capsule_uuid_add').append(
482
                                $('<option>', {
482
                                $('<option>', {
483
                                    value: element.id,
483
                                    value: element.id,
484
                                    text: element.name
484
                                    text: element.name
485
                                })
485
                                })
Línea 531... Línea 531...
531
            })
531
            })
532
                .done(function (response) {
532
                .done(function (response) {
533
                    if (response['success']) {
533
                    if (response['success']) {
534
                        $('#form-edit').attr('action', url)
534
                        $('#form-edit').attr('action', url)
Línea 535... Línea 535...
535
 
535
 
Línea 536... Línea 536...
536
                        $('#form-edit #capsule_uuid').children().not(':first').remove()
536
                        $('#form-edit #capsule_uuid_edit').children().not(':first').remove()
537
 
537
 
538
                        $.each(response['data']['capsules'], function (index, element) {
538
                        $.each(response['data']['capsules'], function (index, element) {
539
                            $('#form-edit #capsule_uuid').append(
539
                            $('#form-edit #capsule_uuid_edit').append(
540
                                $('<option>', {
540
                                $('<option>', {
541
                                    value: element.id,
541
                                    value: element.id,
542
                                    text: element.name
542
                                    text: element.name
Línea 547... Línea 547...
547
                                let data = {
547
                                let data = {
548
                                    id: element.id,
548
                                    id: element.id,
549
                                    name: element.name
549
                                    name: element.name
550
                                }
550
                                }
Línea 551... Línea 551...
551
 
551
 
552
                                $('#form-edit #table-capsules tbody').append(
552
                                $('#form-edit #table-capsules-edit tbody').append(
553
                                    $('#trCapsuleTemplate').render(data)
553
                                    $('#trCapsuleTemplate').render(data)
554
                                )
554
                                )
555
                            }
555
                            }
Línea 791... Línea 791...
791
            maxFileCount: 1,
791
            maxFileCount: 1,
792
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $marketplace_size',
792
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $marketplace_size',
793
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
793
            allowedFileExtensions: ['jpeg', 'jpg', 'png']
794
        })
794
        })
Línea 795... Línea 795...
795
 
795
 
796
        // Evento de botón de seleccionar capsule
796
        // Evento de botón de seleccionar capsule para formulario de agregar
797
        $('#btn-select-capsule').click(function (e) {
797
        $('#btn-select-capsule-add').click(function (e) {
Línea 798... Línea 798...
798
            e.preventDefault()
798
            e.preventDefault()
Línea 799... Línea 799...
799
 
799
 
Línea 800... Línea 800...
800
            var id = $('#capsule_uuid option:selected').val()
800
            var id = $('#capsule_uuid_add option:selected').val()
801
 
801
 
802
            if (!id) return false
802
            if (!id) return false
Línea 803... Línea 803...
803
 
803
 
Línea 804... Línea 804...
804
            var name = $('#capsule_uuid option:selected').text()
804
            var name = $('#capsule_uuid_add option:selected').text()
Línea 805... Línea 805...
805
            var key = '#tr_capsule_id_' + id
805
            var key = '#tr_capsule_id_' + id
Línea -... Línea 806...
-
 
806
            var element = $(key)
-
 
807
 
-
 
808
            if (element.length > 0) return false
-
 
809
 
-
 
810
            if (name.length > 50) name = name.substr(0, 50) + '...'
-
 
811
 
806
            var element = $(key)
812
            let data = { id, name }
-
 
813
 
-
 
814
            $('#table-capsules-add tbody').append($('#trCapsuleTemplate').render(data))
-
 
815
 
-
 
816
            return false
-
 
817
        })
-
 
818
 
807
 
819
        // Evento de botón de seleccionar capsule para formulario de editar
-
 
820
        $('#btn-select-capsule-edit').click(function (e) {
808
            if (element.length > 0) return false
821
            e.preventDefault()
-
 
822
 
-
 
823
            var id = $('#capsule_uuid_edit option:selected').val()
-
 
824
 
-
 
825
            if (!id) return false
-
 
826
 
-
 
827
            var name = $('#capsule_uuid_edit option:selected').text()
-
 
828
            var key = '#tr_capsule_id_' + id
-
 
829
            var element = $(key)
Línea 809... Línea 830...
809
 
830
 
810
            if (name.length > 50) name = name.substr(0, 50) + '...'
831
            if (element.length > 0) return false
Línea 811... Línea 832...
811
 
832
 
812
            let data = { id, name }
833
            if (name.length > 50) name = name.substr(0, 50) + '...'
813
 
-
 
814
            $('#table-capsules tbody').each(function() {
834
 
815
                $(this).append($('#trCapsuleTemplate').render(data))
835
            let data = { id, name }
816
            })
836
 
-
 
837
            $('#table-capsules-edit tbody').append($('#trCapsuleTemplate').render(data))
-
 
838
 
-
 
839
            return false
-
 
840
        })
-
 
841
 
-
 
842
        // Configuración del formulario de creación
-
 
843
        $('#capsule_uuid_add').select2({
-
 
844
            theme: 'bootstrap-5',
-
 
845
            width: '100%',
817
 
846
            placeholder: 'LABEL_SELECT',
-
 
847
            multiple: false
-
 
848
        })
-
 
849
 
-
 
850
        // Configuración del formulario de edición
-
 
851
        $('#capsule_uuid_edit').select2({
-
 
852
            theme: 'bootstrap-5',
-
 
853
            width: '100%',
818
            return false
854
            placeholder: 'LABEL_SELECT',
Línea 819... Línea 855...
819
        })
855
            multiple: false
820
 
856
        })
821
        // Configuración del formulario de creación
857
 
Línea 1057... Línea 1093...
1057
                    </div>
1093
                    </div>
1058
                </div>
1094
                </div>
Línea 1059... Línea 1095...
1059
 
1095
 
1060
                <div class="row">
1096
                <div class="row">
1061
                    <div class="col-8 mt-3">
1097
                    <div class="col-8 mt-3">
1062
                        <select name="capsule_uuid" id="capsule_uuid">
1098
                        <select name="capsule_uuid" id="capsule_uuid_add">
1063
                            <option value="">LABEL_SELECT</option>
1099
                            <option value="">LABEL_SELECT</option>
1064
                        </select>
1100
                        </select>
1065
                    </div>
1101
                    </div>
1066
                    <div class="col-4 mt-3">
1102
                    <div class="col-4 mt-3">
1067
                        <button type="button" class="btn btn-primary" id="btn-select-capsule" data-toggle="tooltip" title="LABEL_ADD LABEL_CAPSULE">LABEL_ADD LABEL_CAPSULE</button>
1103
                        <button type="button" class="btn btn-primary" id="btn-select-capsule-add" data-toggle="tooltip" title="LABEL_ADD LABEL_CAPSULE">LABEL_ADD LABEL_CAPSULE</button>
1068
                    </div>
1104
                    </div>
Línea 1069... Línea 1105...
1069
                </div>
1105
                </div>
1070
                
1106
                
1071
                <div class="row">
1107
                <div class="row">
1072
                    <div class="col-12 mt-3">
1108
                    <div class="col-12 mt-3">
1073
                        <table id="table-capsules" class="table table-bordered">
1109
                        <table id="table-capsules-add" class="table table-bordered">
1074
                            <thead>
1110
                            <thead>
1075
                                <tr>
1111
                                <tr>
1076
                                    <th>LABEL_NAME</th>
1112
                                    <th>LABEL_NAME</th>
Línea 1220... Línea 1256...
1220
                    </div>
1256
                    </div>
1221
                </div> 
1257
                </div> 
Línea 1222... Línea 1258...
1222
 
1258
 
1223
                <div class="row">
1259
                <div class="row">
1224
                    <div class="col-8 mt-3">
1260
                    <div class="col-8 mt-3">
1225
                        <select name="capsule_uuid" id="capsule_uuid">
1261
                        <select name="capsule_uuid" id="capsule_uuid_edit">
1226
                            <option value="">LABEL_SELECT</option>
1262
                            <option value="">LABEL_SELECT</option>
1227
                        </select>
1263
                        </select>
1228
                    </div>
1264
                    </div>
1229
                    <div class="col-4 mt-3">
1265
                    <div class="col-4 mt-3">
1230
                        <button type="button" class="btn btn-primary" id="btn-select-capsule" data-toggle="tooltip" title="LABEL_ADD LABEL_CAPSULE">LABEL_ADD LABEL_CAPSULE</button>
1266
                        <button type="button" class="btn btn-primary" id="btn-select-capsule-edit" data-toggle="tooltip" title="LABEL_ADD LABEL_CAPSULE">LABEL_ADD LABEL_CAPSULE</button>
1231
                    </div>
1267
                    </div>
Línea 1232... Línea 1268...
1232
                </div>
1268
                </div>
1233
                
1269
                
1234
                <div class="row">
1270
                <div class="row">
1235
                    <div class="col-12 mt-3">
1271
                    <div class="col-12 mt-3">
1236
                        <table id="table-capsules" class="table table-bordered">
1272
                        <table id="table-capsules-edit" class="table table-bordered">
1237
                            <thead>
1273
                            <thead>
1238
                                <tr>
1274
                                <tr>
1239
                                    <th>LABEL_NAME</th>
1275
                                    <th>LABEL_NAME</th>