Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17214 Rev 17215
Línea 477... Línea 477...
477
 
477
 
478
                        $('#form-add #capsule_uuid_add').children().not(':first').remove()
478
                        $('#form-add #capsule_uuid_add').children().not(':first').remove()
479
                        $.each(response['data']['capsules'], function (index, element) {
479
                        $.each(response['data']['capsules'], function (index, element) {
480
                            $('#form-add #capsule_uuid_add').append(
480
                            $('#form-add #capsule_uuid_add').append(
481
                                $('<option>', {
481
                                $('<option>', {
482
                                    value: element.id,
482
                                    value: element.uuid,
483
                                    text: element.name
483
                                    text: element.name
484
                                })
484
                                })
485
                            )
485
                            )
Línea 535... Línea 535...
535
                        $('#form-edit #capsule_uuid_edit').children().not(':first').remove()
535
                        $('#form-edit #capsule_uuid_edit').children().not(':first').remove()
Línea 536... Línea 536...
536
 
536
 
537
                        $.each(response['data']['capsules'], function (index, element) {
537
                        $.each(response['data']['capsules'], function (index, element) {
538
                            $('#form-edit #capsule_uuid_edit').append(
538
                            $('#form-edit #capsule_uuid_edit').append(
539
                                $('<option>', {
539
                                $('<option>', {
540
                                    value: element.id,
540
                                    value: element.uuid,
541
                                    text: element.name
541
                                    text: element.name
542
                                })
542
                                })
Línea 543... Línea 543...
543
                            )
543
                            )
544
 
544
 
545
                            if (element.selected) {
545
                            if (element.selected) {
546
                                let data = {
546
                                let data = {
547
                                    id: element.id,
547
                                    id: element.uuid,
Línea 548... Línea 548...
548
                                    name: element.name
548
                                    name: element.name
549
                                }
549
                                }
Línea 794... Línea 794...
794
 
794
 
795
        // Evento de botón de seleccionar capsule para formulario de agregar
795
        // Evento de botón de seleccionar capsule para formulario de agregar
796
        $('#btn-select-capsule-add').click(function (e) {
796
        $('#btn-select-capsule-add').click(function (e) {
Línea 797... Línea 797...
797
            e.preventDefault()
797
            e.preventDefault()
Línea 798... Línea 798...
798
 
798
 
Línea 799... Línea 799...
799
            var id = $('#capsule_uuid_add option:selected').val()
799
            var uuid = $('#capsule_uuid_add option:selected').val()
800
 
800
 
801
            if (!id) return false
801
            if (!uuid) return false
Línea 802... Línea 802...
802
 
802
 
Línea 803... Línea 803...
803
            var name = $('#capsule_uuid_add option:selected').text()
803
            var name = $('#capsule_uuid_add option:selected').text()
Línea 804... Línea 804...
804
            var key = '#tr_capsule_id_' + id
804
            var key = '#tr_capsule_uuid_' + uuid
Línea 805... Línea 805...
805
            var element = $(key)
805
            var element = $(key)
Línea 806... Línea 806...
806
 
806
 
807
            if (element.length > 0) return false
807
            if (element.length > 0) return false
Línea 808... Línea 808...
808
 
808
 
809
            if (name.length > 50) name = name.substr(0, 50) + '...'
809
            if (name.length > 50) name = name.substr(0, 50) + '...'
810
 
810
 
Línea 811... Línea 811...
811
            let data = { id, name }
811
            let data = { uuid, name }
Línea 812... Línea 812...
812
 
812
 
Línea 813... Línea 813...
813
            $('#table-capsules-add tbody').append($('#trCapsuleTemplate').render(data))
813
            $('#table-capsules-add tbody').append($('#trCapsuleTemplate').render(data))
814
 
814
 
815
            return false
815
            return false
Línea 816... Línea 816...
816
        })
816
        })
Línea 817... Línea 817...
817
 
817
 
Línea 818... Línea 818...
818
        // Evento de botón de seleccionar capsule para formulario de editar
818
        // Evento de botón de seleccionar capsule para formulario de editar
Línea 819... Línea 819...
819
        $('#btn-select-capsule-edit').click(function (e) {
819
        $('#btn-select-capsule-edit').click(function (e) {
Línea 820... Línea 820...
820
            e.preventDefault()
820
            e.preventDefault()
821
 
821
 
Línea 855... Línea 855...
855
        })
855
        })
Línea 856... Línea 856...
856
 
856
 
857
        // Evento para remover cápsulas de las tablas
857
        // Evento para remover cápsulas de las tablas
858
        $('body').on('click', '.btn-remove-capsule', function (e) {
858
        $('body').on('click', '.btn-remove-capsule', function (e) {
859
            e.preventDefault()
859
            e.preventDefault()
860
            var id = $(this).data('id')
860
            var uuid = $(this).data('uuid')
861
            $('#tr_capsule_id_' + id).remove()
861
            $('#tr_capsule_uuid_' + uuid).remove()
862
            return false
862
            return false
Línea 863... Línea 863...
863
        })
863
        })
864
 
864
 
Línea 1386... Línea 1386...
1386
		</div>
1386
		</div>
1387
	</div>
1387
	</div>
1388
</div>
1388
</div>
Línea 1389... Línea 1389...
1389
 
1389
 
1390
<script id="trCapsuleTemplate" type="text/x-jsrender">
1390
<script id="trCapsuleTemplate" type="text/x-jsrender">
1391
    <tr id="tr_capsule_id_{{:id}}">
1391
    <tr id="tr_capsule_uuid_{{:uuid}}">
1392
       <td class="text-left">
1392
       <td class="text-left">
1393
            <input type="hidden" class="capsule_id" name="capsule_uuid" value="{{:id}}" />      
1393
            <input type="hidden" class="capsule_uuid" name="capsule_uuid" value="{{:uuid}}" />      
1394
            <span class="d-none d-md-inline">{{:name}}</span>
1394
            <span class="d-none d-md-inline">{{:name}}</span>
1395
       </td>   
1395
       </td>   
1396
       <td>
1396
       <td>
1397
            <button class="btn btn-default btn-remove-capsule" data-id="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE">
1397
            <button class="btn btn-default btn-remove-capsule" data-uuid="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE">
1398
                <i class="fa fa-ban" aria-hidden="true"></i>
1398
                <i class="fa fa-ban" aria-hidden="true"></i>
1399
                <span class="d-none d-md-inline">LABEL_DELETE</span>
1399
                <span class="d-none d-md-inline">LABEL_DELETE</span>
1400
            </button>   
1400
            </button>   
1401
       </td>
1401
       </td>