Changeset ae65f8e in firmaeventos for static/js/funciones.js
- Timestamp:
- Nov 20, 2017, 2:46:47 PM (6 years ago)
- Branches:
- master
- Children:
- 5dea5ff
- Parents:
- 5db8af8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
static/js/funciones.js
r2f56f4e rae65f8e 1 /** 2 * Funcion para refrescar el captcha 3 * @param element Recibe el parametro 4 */ 5 1 6 function refresh_captcha(element) { 2 7 $form = $(element).parents('form'); … … 9 14 10 15 return false; 11 } 16 } 17 18 /** 19 * Función para obtener los usuarios de un evento 20 */ 21 function get_event_user() { 22 var modal = false; 23 var pasaporte = $('#id_pasaporte').val(); 24 if (pasaporte!='') { 25 var routes = $(location).attr('pathname').split('/'); 26 var pk = routes[routes.length-1]; 27 var url = URL_USUARIO_EVENTO+pk+"/"+pasaporte; 28 $.getJSON(url, function(data){ 29 if (Object.keys(data).length > 0) { 30 construir_datos(data.datos); 31 } 32 else{ 33 simple_modal('Lo sentimos, no esta registrado para firmar'); 34 } 35 }).fail(function(jqxhr, textStatus, error) { 36 simple_modal('Petición fállida' + textStatus + ", " + error); 37 }) 38 } 39 else{ 40 simple_modal('Debe ingresar un pasaporte'); 41 } 42 } 43 44 /** 45 * Función para crear un modal sencillo 46 */ 47 function simple_modal(mensaje) { 48 MaterialDialog.alert( 49 mensaje, 50 { 51 title:'Alerta', 52 buttons:{ 53 close:{ 54 text:'cerrar', 55 className:'red', 56 } 57 } 58 } 59 ); 60 } 61 62 /** 63 * Función para construir la data del participante 64 * @param data Recibe los datos para crear la lista 65 */ 66 function construir_datos(data) { 67 $('#datos_paricipante').html(''); 68 html = '<ul class="collection">' 69 html += '<li class="collection-item"><b>Nombre: </b>'+data.nombres+'</li>'; 70 html += '<li class="collection-item"><b>Apellido: </b>'+data.apellidos+'</li>'; 71 html += '<li class="collection-item"><b>Pasaporte: </b>'+data.pasaporte+'</li>'; 72 html += '<li class="collection-item"><b>Correo: </b>'+data.correo+'</li>'; 73 html += '</ul>'; 74 $('#datos_paricipante').html(html); 75 }
Note: See TracChangeset
for help on using the changeset viewer.