diff --git a/_dt/js/event.js b/_dt/js/event.js index f59fa9c..8bdd42a 100644 --- a/_dt/js/event.js +++ b/_dt/js/event.js @@ -18,7 +18,7 @@ $(document).ready(function() { $('.select-asistentes').select2(); - $('#delete-href').on('click', function(evt) { + $('.delete-eve').on('click', function(evt) { evt.preventDefault(); var data = { 'id': $('.event-content').data('id') @@ -28,6 +28,7 @@ $(document).ready(function() { type: 'POST', url: '/eliminarEvento', data: data, + type: 'json', success: function(resp) { if (resp.response === true) { window.location = "/miseventos"; @@ -55,8 +56,12 @@ $(document).ready(function() { type: 'POST', url: '/iAsistente', data: data, + dataType: 'json', success: function(resp) { + var as = ''+data.nombre+''+data.apellidos+''+data.dni+'No ha asistido'; + $('#modalAsistente').modal('hide'); + $('.tasistentes').append(as); } }); }); diff --git a/templates/templateEvents.html b/templates/templateEvents.html index 9c0173e..a63247f 100644 --- a/templates/templateEvents.html +++ b/templates/templateEvents.html @@ -52,7 +52,7 @@

{{ evento.nombre }} {{ evento.fecha }} - {{ evento.hora }} - + {% endif %} @@ -117,13 +117,17 @@

UbicaciĆ³n
- + {% for a in evento.asistentes %} {{ a.nombre }} {{ a.apellidos }} {{ a.dni }} - + {% if a.asistido %} + Asistido + {% else %} + No ha asistido + {% endif %}