Changeset 16cf088 in firmaeventos for static/js


Ignore:
Timestamp:
Nov 20, 2017, 3:54:37 PM (7 years ago)
Author:
lhernandez <lhernandez@…>
Branches:
master
Children:
8ec6ee3
Parents:
94b3e3f (diff), def10d2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Implementado registro de eventos

Location:
static/js
Files:
1 added
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
    16function refresh_captcha(element) {
    27    $form = $(element).parents('form');
     
    914
    1015    return false;
    11 }
     16}
     17
     18/**
     19 * Función para obtener los usuarios de un evento
     20*/
     21function 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*/
     47function 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*/
     66function 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.