- Fecha y hora:
- 30/03/2017 11:10:01 (hace 7 años)
- Branches:
- master, base, constituyente, estudiantes, general, plan_patria, sala
- Children:
- bf7c8cf
- Parents:
- 16123b3
- Ubicación:
- static
- Ficheros:
-
- 9 añadidos
- 2 editados
Leyenda
- No modificado
- Añadido
- Eliminado
-
static/css/style.css
r95b08c1 r0ff122b 187 187 width: 90%; 188 188 } 189 190 .init_button{ 191 width: 250px; 192 } -
static/js/funciones.js
r16123b3 r0ff122b 491 491 492 492 /** 493 * Función para validarla encuesta493 * Función para enviar los respuestas de la encuesta 494 494 * @param event Recibe el evento 495 495 **/ 496 function validate_poll(event) {496 function send_poll(event) { 497 497 event.preventDefault(); 498 $('.btn-success').attr('disabled',true); 499 var form = $("#encuesta_form"); 500 var routes = $(location).attr('pathname').split('/') 501 var id = routes[routes.length-1] 502 $.ajax({ 503 type: 'POST', 504 data: $(form).serialize(), 505 url: "/participacion/"+id, 506 success: function(response) { 507 if (response.code == true) { 508 bootbox.alert("Se registró su participación con éxito <br>Será direccionado en 4 segundos"); 509 setTimeout(function(){ 510 $(location).attr('href', $(location).attr('origin')+'/participacion-busqueda/'+id) 511 },4000); 512 } 513 else{ 514 bootbox.alert("Ocurrió un error inesperado"); 515 $('.btn-success').attr('disabled',false); 516 } 517 }, 518 error:function(error) 519 { 520 bootbox.alert("Ocurrió un error inesperado"); 521 $('.btn-success').attr('disabled',false); 522 } 523 }); 524 498 525 } 499 526 … … 562 589 } 563 590 } 591 592 /** 593 * Función para crear el pre-procesamiento por ajax 594 * @param {object} form Recibe el formulario 595 */ 596 function createPreprocess(form) { 597 bootbox.alert("Se le notifcará cuando finalice el pre-procesamiento"); 598 $.ajax({ // create an AJAX call... 599 data: $(form).serialize(), // get the form data 600 type: $(form).attr('method'), // GET or POST 601 url: $(form).attr('action'), // the file to call 602 success: function(response) { // on success.. 603 if (response.code) { 604 bootbox.alert("Se finalizó con éxito"); 605 } 606 else{ 607 $('.container').html(response); 608 } 609 } 610 }); 611 } 612 613 /** 614 * Función para traer el listado de tópicos 615 * @param {object} element Recibe el elemento 616 * @param {object} event Recibe el evento 617 * @param {int} id Recibe el id del procesamiento 618 */ 619 function visualize(element,event,id) { 620 event.preventDefault(); 621 $('#status').show(500); 622 var text = $(element).text(); 623 var number = text.split(" ")[0] 624 $('#visualize').text(text); 625 var url = '/administador/visualizacion/generate_topics/'+id+"/"+number; 626 $.get(url,function(data){ 627 if (data) { 628 $('#topicos').html(''); 629 $.each(data,function(index,value){ 630 var words_ordered = Object.keys(value.words).sort(function(a,b){return value.words[b]-value.words[a];}); 631 var html = "<div class='panel panel-default'>"; 632 var url = '/administador/visualizacion/topic/'+id+'/'+number+'/'+index; 633 html += "<div class='panel-heading' style='background-color:"+value.color+"'>"; 634 html += "Tópico #"+index; 635 html += "</div><div class='panel-body'>"; 636 html += words_ordered.join(", "); 637 html += "</div><div class='panel-footer'>"; 638 html += "<a type='button' class='btn btn-default' href='"+url+"'>Ver Documentos para Tópico #"+index+"</a>" 639 html += "</div></div>"; 640 $('#topicos').append(html); 641 $('#status .progress-bar').addClass('progress-bar-success').css("width","100%").attr("aria-valuenow","100").text("Completado!"); 642 }); 643 $('#status').hide(2000); 644 } 645 else 646 { 647 $('#status .progress-bar').removeClass('active progress-bar-striped').text('No se pudieron cargar los tópicos.'); 648 } 649 }); 650 } 651 652
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.