Changeset 044d29e in observatorio
- Timestamp:
- Oct 16, 2014, 5:16:41 PM (10 years ago)
- Branches:
- master
- Children:
- aba9df1, 24668a6
- Parents:
- 0bdec62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
procesos/templates/autenticar/usuario.html
r9b0477d r044d29e 11 11 <script type="text/javascript" src="{% static 'js/external/json2.min.js' %}" ></script> 12 12 <script type="text/javascript" src="{% static 'js/jquery.jtable.min.js' %}"></script> 13 <script type="text/javascript" src="{% static 'js/jquery.jtable.es.js' %}"> 14 15 <script type="text/javascript"> 16 $(document).ready(function() { 17 $('a.descarga').on("click",function() { 18 $('#dialog-modal').prop('style',"text-align: center; display: none"); 19 $('#dialog-modal').dialog("close"); 20 }); 21 }); 22 23 24 25 </script> 26 <script type="text/javascript"> 27 $(document).ready(function () { 28 $('img.thumbnail').click(function() { 29 $('#dialog-modal').prop('style',"text-align: center; display: none"); 30 var url = '{{BASE_URL}}/tmp/'+ this.id +'.pdf'; 31 alert('hola'); 32 window.open(url,'_blank'); 33 }); 34 $('#dialog-modal').prop('style',"text-align: center; display: none"); 35 $('#TareasTableContainer').jtable({ 36 title: 'Cadenas Productivas', 37 paging: true, 38 pageSize: 20, 39 sorting: true, 40 defaultSorting: 'id DESC', 41 selecting: true, //Enable selecting 42 multiselect: false, //Allow multiple selecting 43 selectingCheckboxes: true, 44 selectOnRowClick: false, 45 deleteConfirmation: function(data) { 46 data.deleteConfirmMessage = 'Seguro de Eliminar la Cadena Productiva ' + data.record.task_id + '?'; 47 }, 48 //data: { 49 // busca: '', 50 // seleccion: '' 51 // }, 52 ajaxSettings: { 53 type: 'GET', 54 dataType: 'json', 55 }, 56 57 actions: { 58 listAction: '{{BASE_URL}}/tareajson/tareajson?jtStartIndex=0&jtPageSize=10', 59 //updateAction: '{{BASE_URL}}/unidadecon_detalle/?unidadecon_id=', 60 deleteAction: '{{BASE_URL}}/tareajson/tareaborrar', 61 }, 62 fields: { 63 id:{ 64 key: true, 65 create: false, 66 edit: true, 67 list: false 68 }, 69 descripcion: { 70 title: 'Descripción', 71 sorting: false, 72 width: '60%' 73 }, 74 fecha:{ 75 title: 'Fecha', 76 sorting: false, 77 width: '20%' 78 //type: 'date' 79 }, 80 //estatus: { 81 // title: 'Estado', 82 // width: '5%' 83 // }, 84 descargar:{ 85 title: 'Descargar', 86 sorting: false, 87 width:'5%', 88 display: function (data) { 89 if (data.record.estatus == 'SUCCESS'){ 90 return '<a href="{{BASE_URL}}/tmp/'+data.record.task_id+'.pdf" class="descarga" download><img src="{% static 'images/Descargar_ICONO.png' %}" style="vertical-align: bottom" width="65%" height="50%"></a>'; 91 } 92 return 'EN PROCESO'; 93 } 94 } 95 }, 96 selectionChanged: function () { 97 //Get all selected rows 98 var $selectedRows = $('#TareasTableContainer').jtable('selectedRows'); 99 100 $('#SelectedRowList').empty(); 101 if ($selectedRows.length > 0) { 102 103 $selectedRows.each(function () { 104 var record = $(this).data('record'), task = ''; 105 $('#SelectedRowList').append(task = record.task_id); 106 Graficar(task); 107 }); 108 } else { 109 //No rows selected 110 $('#SelectedRowList').append('No row selected! Select rows to see here...'); 13 <script type="text/javascript" src="{% static 'js/jquery.jtable.es.js' %}"></script> 14 15 <script type="text/javascript"> 16 $(document).ready(function() { 17 $('a.descarga').on("click",function() { 18 $('#dialog-modal').prop('style',"text-align: center; display: none"); 19 $('#dialog-modal').dialog("close"); 20 }); 21 }); 22 </script> 23 <script type="text/javascript"> 24 $(document).ready(function () { 25 $('img.thumbnail').click(function() { 26 $('#dialog-modal').prop('style',"text-align: center; display: none"); 27 var url = '{{BASE_URL}}/tmp/'+ this.id +'.pdf'; 28 alert('hola'); 29 window.open(url,'_blank'); 30 }); 31 32 $('#dialog-modal').prop('style',"text-align: center; display: none"); 33 $('#TareasTableContainer').jtable({ 34 title: 'Cadenas Productivas', 35 paging: true, 36 pageSize: 20, 37 sorting: true, 38 defaultSorting: 'id DESC', 39 selecting: true, //Enable selecting 40 multiselect: false, //Allow multiple selecting 41 selectingCheckboxes: true, 42 selectOnRowClick: false, 43 deleteConfirmation: function(data) { 44 data.deleteConfirmMessage = 'Seguro de Eliminar la Cadena Productiva ' + data.record.task_id + '?'; 45 }, 46 //data: { 47 // busca: '', 48 // seleccion: '' 49 // }, 50 ajaxSettings: { 51 type: 'GET', 52 dataType: 'json' 53 }, 54 actions: { 55 listAction: '{{BASE_URL}}/tareajson/tareajson?jtStartIndex=0&jtPageSize=10', 56 //updateAction: '{{BASE_URL}}/unidadecon_detalle/?unidadecon_id=', 57 deleteAction: '{{BASE_URL}}/tareajson/tareaborrar' 58 }, 59 fields: { 60 id: { 61 key: true, 62 create: false, 63 edit: true, 64 list: false 65 }, 66 descripcion: { 67 title: 'Descripción', 68 sorting: false, 69 width: '60%' 70 }, 71 fecha:{ 72 title: 'Fecha', 73 sorting: false, 74 width: '20%' 75 //type: 'date' 76 }, 77 //estatus: { 78 // title: 'Estado', 79 // width: '5%' 80 // }, 81 descargar: { 82 title: 'Descargar', 83 sorting: false, 84 width:'5%', 85 display: function (data) { 86 if (data.record.estatus == 'SUCCESS') { 87 return '<a href="{{BASE_URL}}/tmp/'+data.record.task_id+'.pdf" class="descarga" download><img src="{% static 'images/Descargar_ICONO.png' %}" style="vertical-align: bottom" width="65%" height="50%"></a>'; 111 88 } 112 } 113 114 115 116 117 }); 118 119 //Re-load records when user click 'load records' button. 120 $('#saveForm').click(function (e) { 121 e.preventDefault(); 122 123 $('#TareasTableContainer').jtable('load', { 124 busca: $('#id_busca').val(), 125 seleccion: $("input[name='seleccion']:checked").val() 126 //$('#id_seleccion_1').val() 127 }); 89 return 'EN PROCESO'; 90 } 91 }, 92 georeferenciar: { 93 title: 'Georeferencia', 94 sorting: false, 95 width: '5%', 96 display: function (data) { 97 if (data.record.estatus == 'SUCCESS') { 98 return "<a href='{{ BASE_URL }}/sig/geocadena/?grafo_id='" + data.record.task_id + 99 "target='_blank'>Georeferenciar Cadena" + 100 "<img src='{% static 'geocadena/imgs/icons/world.png' %}'></a>"; 101 } 102 return 'NO DISPONIBLE' 103 } 104 } 105 }, 106 selectionChanged: function () { 107 //Get all selected rows 108 var $selectedRows = $('#TareasTableContainer').jtable('selectedRows'); 109 110 $('#SelectedRowList').empty(); 111 112 if ($selectedRows.length > 0) { 113 $selectedRows.each(function () { 114 var record = $(this).data('record'), task = ''; 115 $('#SelectedRowList').append(task = record.task_id); 116 Graficar(task); 117 }); 118 } else { 119 //No rows selected 120 $('#SelectedRowList').append('No row selected! Select rows to see here...'); 121 } 122 } 123 124 }); 125 126 //Re-load records when user click 'load records' button. 127 $('#saveForm').click(function (e) { 128 e.preventDefault(); 129 130 $('#TareasTableContainer').jtable('load', { 131 busca: $('#id_busca').val(), 132 seleccion: $("input[name='seleccion']:checked").val() 133 //$('#id_seleccion_1').val() 134 }); 128 135 //$('#dialog-modal').prop('style',"text-align: center; display: none"); 129 136 $('#dialog-modal').dialog('close'); 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 }; 137 }); 138 139 //Load all records when page is first shown 140 $('#saveForm').click(); 141 // $('#PlantsTableContainer').jtable('load'); 142 $('#dialog-modal').dialog('close'); 143 }); 144 145 function Graficar(task) { 146 //code 147 $('#dialog-modal').prop('style',"text-align: center; display: none"); 148 var url = '{{BASE_URL}}/tmp/'+ task +'.pdf'; 149 //alert(url); 150 window.open(url,'_blank'); 151 } 145 152 </script> 146 153
Note: See TracChangeset
for help on using the changeset viewer.